Page MenuHomePhabricator

PNG files with truncated PNG IEND chunk are published, but no thumbs are generated
Open, Needs TriagePublicBUG REPORT

Description

Sometimes the upload process on the server changes from assembling stage to publish stage even though the last byte of a file has been upload but not become part of the assembled file (last byte of the file is missing). The file never the less gets published, but no thumbs are generated because of a truncated PNG IEND chunk.

Web browsers, MS Windows, Exiftool and GIMP do display PNGs with a truncated IEND chunk, Mastodon rejects such files.

Examples:
[[File:Diversity_2023_25_(video_capture_049).png]]
[[File:Diversity_2023_25_(video_capture_194).png]]
[[File:Diversity_2023_25_(video_capture_268).png]]
[[File:Diversity_2023_25_(video_capture_529).png]]

What should have happened instead?:

Either these files should not be accepted for publishing at all, or thumbor should create thumbs never the less.

Event Timeline

@C.Suthorn: Thanks for reporting this. For future reference, please use the bug report form (linked from the top of the task creation page) to create a bug report, and fill in the sections in the template instead of deleting them. Please also provide full links to test cases.

TheDJ claimed this task.

I think this was fixed earlier this year with the upload fixes that were made. We haven't really had further reports of missing last chunks as far as I can tell, so provisionally closing and it can always be reopened.

Error does still occur (upload from today, image is shown by upload wizard, but not as thumb):

https://commons.wikimedia.org/wiki/File:Test_file_png_with_incomplete_iend_chunk.png

When a chunk is missing, it cannot add it indeed. But chunks should no longer be cut off by chunked uploading itself.

While it is good, that chunked upload does no longer miss the last chunk, it does not change this bug: During upload files undergo checks (does the mime type match the file extension? does the file contain malicous code? Does the file use a free encoding?), therefore an incomplete file should either be rejected at all, or "repaired" (and in the case of an incomplete or even missing IEND chunk of a PNG this is possible: the preview of the Upload wizard itself does it!)

But apart from the two options of rejecting the file and repairing the file, there is a third option: Include an explantion in the file description page: "This file does not show thumbs, as it has an incomplete IEND chunk. User intervention is needed to correct this, by downloading the file, loading it with a graphics software that is lenient WRT incomplete IEND chunks (every modern main stream web browser can be used), saving it and do a revison upload."

The files are corrupted in a way that the upstream libraries Thumbor uses (in this case, libpng) will not ignore. Thumbor does try to work around corruption when possible, but leans toward the side of efficiency rather than fault tolerance and can't work around every possible type of corruption. From the Thumbor perspective, this is working as expected.
I'm replacing the Thumbor tag with MediaWiki-File-management as that handles the user interface for corrupt files and upload checks.