Conversation
A .jp2 is typed correctly on upload and has been since 12.0.0.14, and then nothing can render it: no provider claims image/jp2, no browser decodes the format, so the file opens to nothing. ImageMagick reads it where it was built with OpenJPEG, which is what the other formats libgd cannot read already rely on, and the signature box a .jp2 opens with sits at offset 0 where Bitmap looks for it. So this is the same shape as TIFF: a Bitmap subclass naming the format, off until an admin enables it. libgd is not an option here and never was. It has no JPEG 2000 functions at all, which is why the case for it in OC\Image sits commented out beside the other formats it cannot read. Imaginary answers 406 for one. The pixel assertion the AVIF tests use is not about AVIF, so it loses the name and is shared. Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
skjnldsv
requested review from
CarlSchwan,
come-nc,
icewind1991 and
salmart-dev
and removed request for
a team
September 20, 2026 21:40
It went in beside Imaginary rather than after ImaginaryPDF, which php-cs-fixer and the strict run both objected to. Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
They were overwritten by a copy of another checkout's vendor-bin, made to run php-cs-fixer locally, and swept into the previous commit. That pinned psalm back to 6.16.1 while the baseline is written by 6.17.0, which is what the static analysis was objecting to. Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
You can upload a
.jp2today and Nextcloud types it correctly, and then nothing can render it, so it opens to nothing. No preview provider claimsimage/jp2.ImageMagick reads the format where it was built with OpenJPEG, so this adds
OC\Preview\JP2on the existingBitmapbase, the same shape asTIFF. libgd was never an option: it has no JPEG 2000 support at all, which is why the case for it inOC\Imagesits commented out. Imaginary answers 406 for one.Like the other ImageMagick providers it stays off until an admin adds it to
enabledPreviewProviders, so this is not on-by-default support.I also renamed
AvifPreviewTraittoPreviewPixelsTrait. The assertion in it was never AVIF specific and the new test uses it too.TODO
Checklist
3. to review, feature component)stable32)I ran the tests on a throwaway sqlite instance inside the CI image, which has JP2 in its ImageMagick, rather than leaving it to CI.
JP2Testpasses: four thumbnail sizes, plus a check that the preview actually contains the picture rather than a blank canvas of the right shape, which is all the shared provider test would catch. The AVIF and HEIC tests still pass after the rename.AI (if applicable)