Page MenuHomePhabricator

Preview error for 32 bit HDR files
Open, Needs TriagePublicBUG REPORT

Description

Feature summary (what you would like to be able to do and where):
Sometimes it is needed to cover high-dynamic range when it comes to huge brightness differences (sun and shadow). For this, TIF offers 32 bits per channel to save it digitally. When uploaded, the preview is often just black, which makes users think the file is corrupt, but viewed in Photoshop it shows details.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
Opening a page with this file, like: https://commons.wikimedia.org/wiki/File:Hospitalkirche_20241221_HOF9117-HDR_RAW-Export.tif. The "other files" section shows more engaged files to understand the issue better.

Benefits (why should this be implemented?):
To see at one glance what the work depicts

Event Timeline

Local test container:

thumbor-1  | 2025-05-05 00:41:33 thumbor:DEBUG Loading extension wikimedia_thumbor.handler.images
thumbor-1  | 2025-05-05 00:41:33 thumbor:DEBUG Loading extension wikimedia_thumbor.handler.core
thumbor-1  | 2025-05-05 00:41:33 thumbor:DEBUG Loading extension wikimedia_thumbor.handler.healthcheck
thumbor-1  | 2025-05-05 00:41:33 thumbor:DEBUG Monkey patching ContextHandler.initialize
thumbor-1  | 2025-05-05 00:41:33 root:DEBUG thumbor starting at 0.0.0.0:8800
thumbor-1  | 2025-05-05 00:41:33 asyncio:DEBUG Using selector: EpollSelector
thumbor-1  | 2025-05-05 00:41:41 thumbor:DEBUG METRICS: inc: response.count:1
thumbor-1  | 2025-05-05 00:41:41 thumbor:DEBUG METRICS: inc: response.none_smart:1
thumbor-1  | 2025-05-05 00:41:41 thumbor:DEBUG METRICS: timing: response.none_smart:1
thumbor-1  | 2025-05-05 00:41:41 thumbor:DEBUG METRICS: inc: storage.miss:1
thumbor-1  | 2025-05-05 00:41:41 thumbor:DEBUG [HTTPS] load_sync: https%3A//upload.wikimedia.org/wikipedia/commons/e/e9/Hospitalkirche_20241221_HOF9117-HDR_RAW-Export.tif
thumbor-1  | 2025-05-05 00:41:41 thumbor:DEBUG [HTTPS] Loading normalized URL: https://upload.wikimedia.org/wikipedia/commons/e/e9/Hospitalkirche_20241221_HOF9117-HDR_RAW-Export.tif
thumbor-1  | 2025-05-05 00:41:59 thumbor:DEBUG [HTTPS] return_contents: /tmp/tmp6wbkyp7i
thumbor-1  | 2025-05-05 00:41:59 thumbor:DEBUG METRICS: inc: original_image.status.200:1
thumbor-1  | 2025-05-05 00:41:59 thumbor:DEBUG METRICS: inc: original_image.status.200.upload_wikimedia_org:1
thumbor-1  | 2025-05-05 00:41:59 thumbor:DEBUG METRICS: inc: original_image.response_bytes:4096
thumbor-1  | 2025-05-05 00:41:59 thumbor:DEBUG [Proxy] load: '.tiff'
thumbor-1  | 2025-05-05 00:41:59 thumbor:DEBUG [Proxy] Looking for a tiff engine
thumbor-1  | 2025-05-05 00:41:59 thumbor:DEBUG [ExiftoolRunner] command: ['/usr/bin/exiftool', '-ImageSize', '-j', '-m', '-q', '-q', '/tmp/tmp6wbkyp7i']
thumbor-1  | 2025-05-05 00:41:59 thumbor:DEBUG [ShellRunner] Command: ['/usr/bin/timeout', '--foreground', '60', '/usr/bin/exiftool', '-ImageSize', '-j', '-m', '-q', '-q', '/tmp/tmp6wbkyp7i']
thumbor-1  | 2025-05-05 00:41:59 thumbor:DEBUG [ShellRunner] Stdout: b'[{\n  "SourceFile": "/tmp/tmp6wbkyp7i",\n  "ImageSize": "9490x6327"\n}]\n'
thumbor-1  | 2025-05-05 00:41:59 thumbor:DEBUG [ShellRunner] Stderr: b''
thumbor-1  | 2025-05-05 00:41:59 thumbor:DEBUG [ShellRunner] Return code: 0
thumbor-1  | 2025-05-05 00:41:59 thumbor:DEBUG [ShellRunner] Duration: 138.535
thumbor-1  | 2025-05-05 00:41:59 thumbor:DEBUG [VIPS] Shrinking with command
thumbor-1  | 2025-05-05 00:41:59 thumbor:DEBUG [BWE] Found source file in context
thumbor-1  | 2025-05-05 00:41:59 thumbor:DEBUG [ShellRunner] Command: ['/usr/bin/timeout', '--foreground', '60', '/usr/bin/vips', 'shrink', '/tmp/tmp6wbkyp7i', '/tmp/tmpoex4nzru/vips_result.png', '5', '5']
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Stdout: b''
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Stderr: b"\n(vips:20): VIPS-WARNING **: 00:41:59.854: profile 'icc': 0h: PCS illuminant is not D50\n\n(vips:20): VIPS-WARNING **: 00:41:59.854: bad ICC profile not saved\n"
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Return code: 0
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Duration: 2284.042
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [IM] Dumping buffer into temp file
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ExiftoolRunner] command: ['/usr/bin/exiftool', '-j', '-ImageSize', '-ProfileDescription', '-ColorType', '-FileType', '-Transparency', '-Artist', '-Copyright', '-ImageDescription', '-m', '-q', '-q', '/tmp/tmphaga8uw_']
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Command: ['/usr/bin/timeout', '--foreground', '60', '/usr/bin/exiftool', '-j', '-ImageSize', '-ProfileDescription', '-ColorType', '-FileType', '-Transparency', '-Artist', '-Copyright', '-ImageDescription', '-m', '-q', '-q', '/tmp/tmphaga8uw_']
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Stdout: b'[{\n  "SourceFile": "/tmp/tmphaga8uw_",\n  "ImageSize": "1898x1265",\n  "ColorType": "RGB",\n  "FileType": "PNG"\n}]\n'
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Stderr: b''
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Return code: 0
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Duration: 146.671
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [IM] EXIF: {'SourceFile': '/tmp/tmphaga8uw_', 'ImageSize': '1898x1265', 'ColorType': 'RGB', 'FileType': 'PNG'}
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [IM] File has no ICC profile
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [IM] reorientate
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [IM] resize: 800.0 533.0
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [IM] Queued operators: ['-resize', '800x533^', '-gravity', 'center', '-extent', '800x533']
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG No image format specified. Retrieving from the image extension: .tiff.
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG Content Type of image/tiff detected.
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [BWE] Defaulting to .jpg
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [IM] read: .jpg 79
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [IM] Chroma subsampling: '4:2:0'
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [IM] Generating image with quality 79
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [IM] Queued operators: ['-resize', '800x533^', '-gravity', 'center', '-extent', '800x533', '-quality', '79', '-sampling-factor', '4:2:0', '-interlace', 'Plane']
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Command: ['/usr/bin/timeout', '--foreground', '60', '/usr/bin/convert', '-define', 'tiff:exif-properties=no', '-resize', '800x533^', '-gravity', 'center', '-extent', '800x533', '-quality', '79', '-sampling-factor', '4:2:0', '-interlace', 'Plane', '/tmp/tmphaga8uw_[0]', 'jpg:-']
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Stdout: <too long to display (3075 bytes)>
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Stderr: b''
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Return code: 0
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Duration: 90.521
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [IM] Processing EXIF
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ExiftoolRunner] command: ['/usr/bin/exiftool', '-all=', '-m', '-q', '-q', '/tmp/tmpwv2qffjd', '-o', '-']
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Command: ['/usr/bin/timeout', '--foreground', '60', '/usr/bin/exiftool', '-all=', '-m', '-q', '-q', '/tmp/tmpwv2qffjd', '-o', '-']
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Stdout: <too long to display (3057 bytes)>
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Stderr: b''
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Return code: 0
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG [ShellRunner] Duration: 137.89100000000002
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG METRICS: timing: engine.processing_time.wikimedia_thumbor.engine.vips:3021
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG METRICS: timing: engine.processing_utime.wikimedia_thumbor.engine.vips:2875
thumbor-1  | 2025-05-05 00:42:02 tornado.access:INFO 200 GET /thumbor/unsafe/800x/https://upload.wikimedia.org/wikipedia/commons/e/e9/Hospitalkirche_20241221_HOF9117-HDR_RAW-Export.tif (172.18.0.1) 21210.97ms
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG METRICS: timing: response.time:21210
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG METRICS: timing: response.time.200:21210
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG METRICS: inc: response.status.200:1
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG METRICS: inc: response.not_smart.count:1
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG METRICS: timing: response.not_smart.latency:21210
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG METRICS: inc: response.format.jpg:1
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG METRICS: timing: response.time.jpg:21210
thumbor-1  | 2025-05-05 00:42:02 thumbor:DEBUG METRICS: inc: response.bytes.jpg:3057
thumbor-1  | 2025-05-05 00:42:03 tornado.access:WARNING 404 GET /favicon.ico (172.18.0.1) 1.33ms
thumbor-1  | 2025-05-05 00:42:19 thumbor:DEBUG [HTTPS] cleanup_temp_file: /tmp/tmp6wbkyp7i

This image is thumbnailed by Vips first, then ImageMagick. The version of ImageMagick that Thumbor is running doesn't have HDRI support enabled, but at least produces a usable output image on its own:

image.png (533×800 px, 864 KB)
Vips, on the other hand, produces an almost-entirely black image. Debian Bookworm packages version 8.14.1 of the Vips packages. My Arch Linux laptop has Vips 8.16.1, which thumbnails the image fine:
vips_result-800.png (533×800 px, 2 MB)
Debian Trixie packages the same version, and it works there too. So this should be fixed when Trixie becomes stable and Thumbor is upgraded.

AntiCompositeNumber moved this task from Backlog to Upstream on the Thumbor board.
AntiCompositeNumber moved this task from Backlog to Patch released upstream on the Upstream board.
AntiCompositeNumber changed the subtype of this task from "Feature Request" to "Bug Report".