PhoenixKit 2.23.3: PDF and ICO uploads get their previews again
PhoenixKit 2.23.3 fixes media processing for two kinds of upload: PDFs on servers that have poppler installed, and .ico icons.
On a server with poppler, every uploaded PDF failed during processing and was given up after three attempts, before any preview was made. The page count, author and other details read from the PDF now go into the file’s metadata, and the job finishes. A title someone already gave the file in the media library is kept; the PDF’s own title does not replace it.
Icon files failed every variant, because the copy made for processing had no file extension and ImageMagick needs one to read ICO. The copy now keeps the original’s extension, but only for images, video, audio and PDF.
A server without pdftoppm, pdfinfo, ImageMagick or FFmpeg is now reported as not having the tool, instead of logging pdftoppm error: nil for each PDF.
Full release notes: PhoenixKit 2.23.3
2.23.3 · 15 September 2026
Added
-
mix package.cleandeletes thephoenix_kit-*.tartarballs thatmix hex.build/mix hex.publishleave in the project root (64 of them, 199 MB, had piled up). It runs as the lastmix prereleasestep; run it by hand after a baremix hex.publish. The.gitignoreentry for them, a leftoverphoenix_module_template-*.tarfrom the template repo, now namesphoenix_kit-*.tar. -
mix precommitnow compiles the test tree via a newtest.compilealias, run betweendeps.unlock --check-unusedandquality.ci. No existing gate step ever compiledtest/**/*_test.exs:formatandcredoonly parse them,compileanddialyzerseeelixirc_paths(which coverstest/support, not the.exstest files), and ExUnit is the only thing that compiles those — so a test file that is valid syntax but fails to compile (a duplicatedescribename, for example, which ExUnit rejects atdefmoduletime) passed every step and only surfaced on the nextmix test. The alias compiles every test file withKernel.ParallelCompiler.compile/1in aMIX_ENV=testsubprocess, deliberately withouttest_helper.exs: noExUnit.start, no database probe, no migration, zero tests run, so it cannot go red from the environment — only from a genuine compile error intest/.mix testitself is still not part ofprecommit; see AGENTS.md “CI/CD”.
Fixed
- Stored originals keep their extension when copied out for processing.
Storage.retrieve_file/1— andManager.retrieve_file/2without a:destination_path— wrote the temp copy asphoenix_kit_<random>, with no extension. ImageMagick identifies some formats by extension alone, ICO among them, soProcessFileJobfailed every variant of an.icoupload withidentify: no decode delegate for this image formatand the job was discarded, even where ImageMagick reads ICO. The temp copy now carries the stored original’s extension, asManager.replicate_to_buckets/3already did.AnnotationThumbnailreads its source through the same call (#817). Only a media extension (image, video, audio, PDF —Manager.temp_extension/1) is kept: the extension is the uploader’s filename, and it also selects the ImageMagick coders that have no magic bytes (MVG, MSL, TXT), which an extensionless copy never reached — a.mvguploaded asimage/pngis stored as an image and would have been handed toidentifyas MVG. - A missing
pdftoppm,pdfinfo,identifyorffmpegis reported as not installed.System.cmd/3raisesErlangErrorwith:enoentinoriginalandreason: nil;PdfProcessorandSystem.Dependenciescheckedreason, so the not-installed branch never ran — a host without poppler loggedpdftoppm error: nilfor every PDF, andcheck_imagemagick/0/check_ffmpeg/0returned{:error, "Error checking …: nil"}instead of{:error, :not_installed}. - PDF uploads are processed again on hosts that have poppler.
ProcessFileJobmerged pdfinfo’s string-keyed fields ("page_count","author", …) into the atom-keyed%{status: "active"}update, andEcto.Changeset.cast/3rejects a mixed-key map — so every PDF job raisedEcto.CastErroron the metadata step and was discarded after three attempts, before any preview variant was rendered. Without popplerextract_metadata/1returns%{}and the merge happened to be clean, which is why the crash only showed up once the tool was installed. The fields now go into the file’s:metadatamap (PdfProcessor.file_attrs/2) (#816), filling only keys it doesn’t already hold —"title"is also the user-editable title the media detail page saves there, and a re-processed PDF must not replace it with the document’s own Title.
PhoenixKit 2.23.3. Install or update: {:phoenix_kit, "~> 2.23"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.