Recast

QGIS “Wrong JPEG library version” when opening a TIFF on Mac

If QGIS starts normally but refuses to display a TIFF with “Wrong JPEG library version”, try rewriting it as a DEFLATE-compressed GeoTIFF using a separate, working reader. Recast can do this in your browser if its conversion engine can read the source pixels.

By Recast · Published 8 September 2026 · Troubleshooting guide

QGIS opens, but your TIFF does not?

This guide is for file-loading failures inside a running QGIS session. The separate case where QGIS crashes before you can use it needs installation troubleshooting; converting a TIFF will not fix an application that cannot start.

The same JPEG version message has also been reported during startup: QGIS issue #65849 describes an Intel Mac running QGIS 4.0.1 that crashes on launch. That report does not establish the cause of every TIFF-loading failure. Match the circumstances as well as the error text.

Does this match your file-loading error?

This guide addresses a TIFF read failure on Mac with a message like:

IReadBlock failed at X offset 0, Y offset 0:
libjpeg: Wrong JPEG library version: library is 62, caller expects 80.

You might be able to open other images while this particular TIFF fails. A similar QGIS problem on an Intel Mac prompted this workflow. The message alone does not establish a bug affecting all Intel Macs or a particular QGIS release.

Try a local GeoTIFF rewrite

Keep your original. Select the TIFF and its matching .tfw, if present, then choose GeoTIFF. Your file contents stay on your device.

Open Recast ↗Check file limits first

What “library is 62, caller expects 80” means

The JPEG decoder and the software calling it disagree about their library interface version. The decoder checks this during initialization; it is not a TIFF format version or an instruction to rename the file. See the libjpeg-turbo initialization check.

That makes a library mismatch the relevant diagnosis for this specific message. It does not prove the TIFF is corrupted. The message also does not identify which installed component introduced the mismatch.

Why does a TIFF mention JPEG?

A TIFF can store its image blocks using JPEG compression. GDAL documents this in its GeoTIFF driver reference. JPEG inside the TIFF is a plausible reason for this error; inspect the compression metadata when a working reader can open it. The .tif extension alone does not tell you the compression.

Opening a separate .jpg successfully does not rule out a problem in the reading path used for that TIFF.

How to try the workaround without uploading your file

  1. Keep the original TIFF. Work with a new output file so you can compare the result.
  2. Open Recast and select the .tif or .tiff. If there is a matching .tfw world file, select both together. Wait for the local inspection.
  3. Review the detected metadata. Check the dimensions, bands, compression, and available coordinate system. Successful inspection is not proof that every pixel block can be read.
  4. Choose GeoTIFF and click “Make compatible with QGIS”. Recast attempts to read the raster and write a tiled TIFF with DEFLATE compression. Conversion must finish successfully before a result is offered.
  5. Save the result and open it in QGIS. If the download is a ZIP, extract it and keep its accompanying files together. Check the map location, extent, resolution, bands, and any nodata areas before using it in your work.

Recast runs GDAL WebAssembly with its own conversion libraries, separately from your desktop QGIS installation. That is why it may read a file that triggers a native library mismatch. This is a workaround for the file, not a repair of the QGIS installation.

What changes, and what should stay the same?

The output uses lossless DEFLATE compression instead of JPEG. Recast does not intentionally resize or reproject this conversion, and it checks key raster metadata after reopening the output. A rewrite cannot restore detail already lost through JPEG compression. The new TIFF may be larger.

Available georeferencing is retained where possible. A .tfw supplies pixel positioning, not the coordinate reference system (CRS). If the source has no CRS, Recast cannot invent one. Ask the data provider which CRS to use. See the GeoTIFF conversion guide for world-file handling and other limits.

If Recast cannot read or convert it

Already have a working GDAL installation?

You can try the equivalent kind of rewrite locally from a terminal:

gdal_translate input.tif output-qgis.tif -of GTiff -co COMPRESS=DEFLATE -co TILED=YES -co BIGTIFF=IF_SAFER

This command needs a GDAL installation that can decode the source. It does not fix a mismatched JPEG library. The gdal_translate documentation explains format conversion and creation options.

Is every “IReadBlock failed” error the same?

No. Read the text after it. This article targets the JPEG library version mismatch. A different accompanying error can require a different investigation; a compression rewrite is not a universal repair for damaged raster data.

For other workflows, browse all Recast guides or see when to use Recast alongside QGIS.