مواد تے جاؤ
بلاگ تے واپس
مسئلیاں دا حل
26 فروری، 2026
GuruPDF Team
15 منٹ پڑھن دا ویلا

Why Image Conversion Fails on Your Computer (and How to Fix Every Error)

HEIC not opening? ImageMagick "no decode delegate"? Python Pillow crashing on RGBA? This guide covers every common image conversion error on Windows, macOS, and Linux — with real error codes, explanations, and the easiest fix.

Converting images between formats sounds like it should be simple — just change the extension, right? In reality, thousands of users every day run into cryptic errors, corrupted outputs, and software crashes when trying to convert images on their local machines. Meanwhile, online tools like GuruPDF handle the exact same conversions flawlessly in seconds.

This article dives deep into the most common image conversion errors people encounter on Windows, macOS, and Linux, explains why they happen, and shows you how to avoid them entirely.

The Most Common Image Formats (and Why They Don't Always Play Nice)

Before we get into errors, let's understand the formats that cause the most trouble:

Format Full Name Compression Transparency Typical Use
JPG/JPEG Joint Photographic Experts Group Lossy No Photos, web images
PNG Portable Network Graphics Lossless Yes Screenshots, logos, graphics
WebP Web Picture Both Yes Modern web optimization
HEIC/HEIF High Efficiency Image Container Lossy/Lossless Yes iPhone/iPad photos (iOS 11+)
AVIF AV1 Image File Format Lossy/Lossless Yes Next-gen web format
SVG Scalable Vector Graphics N/A (vector) Yes Icons, illustrations, logos
TIFF Tagged Image File Format Lossless Yes Print, scanning, archival
BMP Bitmap None No Legacy Windows format
GIF Graphics Interchange Format Lossless 1-bit Animations, simple graphics
EPS Encapsulated PostScript N/A (vector) No Print design, professional graphics
DJVU DjVu Lossy No Scanned documents, books

The problem? Most operating systems and built-in tools only support a handful of these natively. That's where the errors begin.

Error #1: "Windows Photo Viewer Can't Open This Picture" (HEIC/AVIF/WebP)

Error codes and messages you might see:

"Windows Photo Viewer can't open this picture because either Photo Viewer
doesn't support this file format, or you don't have the latest updates."
"It looks like we don't support this file format."
— Microsoft Photos app
"0xc00d5212: This item was encoded in a format that's not supported."

Why it happens: Windows 10/11 doesn't natively support HEIC (the default iPhone photo format since iOS 11) or AVIF. You need to install the "HEIF Image Extensions" ($0.99) and "AV1 Video Extensions" from the Microsoft Store. WebP support was only added in Windows 10 version 1809 and later.

The local fix attempt: Install codec packs, use third-party viewers, or try command-line tools like ImageMagick:

bash
magick convert input.heic output.jpg

But ImageMagick requires installing additional delegates (libheif, libde265) which often fails with:

convert: delegate failed `"dwebp" -pam "%i" -o "%o"' @ error/delegate.c/InvokeDelegate/1911.
convert: no decode delegate for this image format `HEIC' @ error/constitute.c/ReadImage/746.

The easy fix: Upload your HEIC, AVIF, or WebP files to GuruPDF and convert them to JPG or PNG in one click — no codecs, no installations, no errors.

Error #2: "No Decode Delegate" — ImageMagick Missing Codecs

Full error message:

convert: no decode delegate for this image format `WEBP' @ error/constitute.c/ReadImage/746.
convert: no decode delegate for this image format `SVG' @ error/constitute.c/ReadImage/746.
convert: no decode delegate for this image format `EPS' @ error/constitute.c/ReadImage/746.

Why it happens: ImageMagick is one of the most popular command-line image tools, but it doesn't include decoders for every format out of the box. Each format requires a "delegate" library:

  • WebP requires libwebp
  • HEIC requires libheif + libde265
  • AVIF requires libavif + dav1d
  • SVG requires librsvg or Inkscape
  • EPS requires Ghostscript (gs)
  • DJVU requires djvulibre

Installing these on Windows is particularly painful — you need to download pre-compiled DLLs, place them in the right directory, and hope the versions match.

On macOS:

bash
brew install imagemagick --with-librsvg --with-libheif --with-webp

Often fails with:

Error: invalid option: --with-librsvg

Because Homebrew changed its formula structure and these options were removed.

On Linux (Ubuntu/Debian):

bash
sudo apt install imagemagick libheif-dev libwebp-dev

May still fail because the system ImageMagick was compiled without the delegate. You'd need to compile from source:

bash
./configure --with-heic=yes --with-webp=yes
make && sudo make install

Which can take 10+ minutes and may conflict with system packages.

Error #3: "Not a JPEG File: Starts With 0x89" — Wrong File Extension

Error messages:

Not a JPEG file: starts with 0x89 0x50
Corrupt JPEG data: premature end of data segment
libpng error: Not a PNG file
IHDR: CRC error

Why it happens: Someone renamed a PNG file to .jpg (or vice versa). The file extension doesn't match the actual binary content. The 0x89 0x50 bytes are the PNG magic number (the first bytes of every PNG file are 89 50 4E 47). JPEG files start with FF D8 FF.

This happens surprisingly often when:

  • Downloading images from the web (servers sometimes set wrong Content-Type headers)
  • Batch renaming files without actually converting them
  • Email clients or messaging apps silently changing extensions

How to identify the real format:

bash
file mysterious-image.jpg
# Output: mysterious-image.jpg: PNG image data, 1920 x 1080, 8-bit/color RGBA

On Windows (PowerShell):

powershell
Format-Hex -Path .\image.jpg -Count 4
# If you see 89 50 4E 47, it's actually a PNG
# If you see FF D8 FF, it's a real JPEG

The online advantage: GuruPDF detects the actual file format automatically, regardless of what the extension says, and converts it correctly.

Error #4: Python Pillow (PIL) Conversion Errors

Common error messages:

python
PIL.UnidentifiedImageError: cannot identify image file 'photo.heic'
python
OSError: cannot write mode RGBA as JPEG
python
OSError: cannot write mode P as JPEG
python
PIL.Image.DecompressionBombError: Image size (178956970 pixels) exceeds limit of 89478485 pixels

Why it happens: Python's Pillow library is the go-to for programmatic image conversion, but it has significant limitations:

  1. No HEIC support without pillow-heif (separate install that requires system libraries)
  2. RGBA to JPEG fails because JPEG doesn't support transparency — you must convert to RGB first
  3. Palette mode (P) to JPEG requires converting to RGB
  4. Large images trigger the decompression bomb protection (a security feature)

Typical workaround code that people struggle with:

python
from PIL import Image

img = Image.open("photo.png")

# Handle transparency for JPEG output
if img.mode in ('RGBA', 'LA', 'P'):
    background = Image.new('RGB', img.size, (255, 255, 255))
    if img.mode == 'P':
        img = img.convert('RGBA')
    background.paste(img, mask=img.split()[-1])
    img = background

img.save("photo.jpg", "JPEG", quality=95)

That's a lot of boilerplate just to convert one image. And it still won't handle HEIC, AVIF, or WebP without extra libraries.

Error #5: macOS Preview "Could Not Be Exported" Errors

Error messages:

"The document 'image.webp' could not be exported as 'image.png'."
"The file isn't compatible with QuickLook."
"The document could not be opened. The file format is not supported."

Why it happens: macOS Preview.app supports a decent range of formats, but older macOS versions (pre-Ventura) don't support WebP or AVIF natively. Even on newer versions, converting between certain format combinations fails silently or produces corrupted output.

Common macOS sips command errors:

bash
sips -s format jpeg input.webp --out output.jpg
# Error: Unable to render input.webp as JPEG
# Error 4: no such operation
bash
sips -s format png input.svg --out output.png
# Error: Unable to render SVG

The sips (Scriptable Image Processing System) tool is built into macOS but only supports a limited set of formats: JPEG, TIFF, PNG, GIF, BMP, and PICT.

Error #6: FFmpeg Image Conversion Failures

Common errors:

[image2 @ 0x...] Could not open file : output.webp
av_interleaved_write_frame(): Invalid argument
Avi/ASF stream 0 is not an image stream. Use -c:v png/mjpeg/... to encode it.
[svg @ 0x...] Cannot determine type of input
[heic @ 0x...] Unknown decoder 'heic'
Discarding frame which has a bad interlace type

Why it happens: FFmpeg is primarily a video tool, and while it can handle image conversions, it requires specific codec support compiled in. Many system-installed versions of FFmpeg lack HEIC/AVIF/WebP support.

Error #7: GIMP Batch Processing Errors

Error messages in Script-Fu console:

Error: ( : 1) eval: unbound variable: file-webp-save
batch command experienced an execution error:
Error: Procedure 'file-heif-load' not found
(gimp:12345): LibGfig-WARNING **: Bad path: /home/user/.gimp-2.10/gfig

Why it happens: GIMP requires plugins for newer formats. The WebP plugin may not be installed, HEIF support requires libheif, and AVIF support requires GIMP 2.10.22+. Batch processing with Script-Fu or Python-Fu adds another layer of complexity.

Error #8: "EXIF Data Lost" — Metadata Destruction During Conversion

This isn't an error message — it's a silent data loss that many people don't notice until it's too late.

What gets lost:

  • Camera settings (aperture, shutter speed, ISO)
  • GPS coordinates (where the photo was taken)
  • Date and time the photo was taken
  • Copyright information
  • Color profile (sRGB, Adobe RGB, ProPhoto RGB)
  • Orientation (rotation information — leading to sideways photos)

Tools that commonly strip EXIF:

  • Windows Paint (strips everything)
  • Many online converters (for "privacy" reasons, without telling you)
  • ImageMagick (can preserve or remove metadata depending on your command; -strip explicitly removes metadata)
  • Python Pillow (requires explicit EXIF handling with exif=img.info.get('exif', b''))

The orientation problem is particularly nasty:

Warning: JPEG file has EXIF orientation tag but image data is not rotated.
Auto-rotating image based on EXIF orientation.

Some tools rotate the image but don't update the EXIF tag, leading to double-rotation on some viewers and correct display on others.

Error #9: Color Space and ICC Profile Issues

Error messages:

lcms: not a valid ICC profile
color profile 'sRGB IEC61966-2.1' is not compatible with 'CMYK'
libpng warning: iCCP: known incorrect sRGB profile
JCS_CMYK JPEG image passed to JFIF converter

Why it happens: Professional images often use CMYK color spaces (for print) or wide-gamut profiles (Adobe RGB, ProPhoto RGB). Converting these to web formats (which use sRGB) without proper color management produces washed-out or oversaturated colors.

What you see: An image that looks perfect on your screen turns neon-green or muddy-brown after conversion. Or a professional photo loses its vibrant colors entirely.

The technical reason: CMYK has 4 color channels (Cyan, Magenta, Yellow, Key/Black) while RGB has 3 (Red, Green, Blue). A naive conversion doesn't apply the proper color transform, resulting in wildly incorrect colors.

Error #10: "File Too Large" or "Out of Memory" Crashes

Error messages:

java.lang.OutOfMemoryError: Java heap space
Traceback: MemoryError
Fatal error: Allowed memory size of 134217728 bytes exhausted
convert: cache resources exhausted `input.tiff' @ error/cache.c/OpenPixelCache/3945.
convert: width or height exceeds limit `input.tiff' @ error/cache.c/OpenPixelCache/3912.

Why it happens: A 100 MB TIFF file at 300 DPI might be 8000×6000 pixels. Uncompressed in memory, that's:

  • 8000 × 6000 × 4 bytes (RGBA) = 192 MB of RAM for a single image
  • Processing (resizing, format conversion) requires 2-3× that amount
  • Batch converting 10 such images can consume 4-6 GB of RAM

Most desktop applications and scripts don't stream-process images — they load the entire thing into memory at once.

ImageMagick's default policy limits are often too restrictive:

# /etc/ImageMagick-6/policy.xml
<policy domain="resource" name="memory" value="256MiB"/>
<policy domain="resource" name="disk" value="1GiB"/>
<policy domain="resource" name="width" value="16KP"/>
<policy domain="resource" name="height" value="16KP"/>

You might need to edit policy.xml to increase these limits, but that requires admin access and understanding of XML configuration.

Error #11: SVG to Raster Conversion — "Text Rendering" Nightmares

Common issues:

Pango-WARNING **: failed to choose a font, expect ugly output
rsvg-convert: error: Error reading SVG: "Unexpected end of XML input"
cairo-WARNING: cairo_surface_destroy: Cannot modify an already-finished surface

Why it happens: SVG files often reference fonts that aren't installed on your system. When converting to PNG or JPG, the rendering engine substitutes a default font, completely changing how text looks. Gradients, filters, and embedded images in SVGs add more potential failure points.

The font problem example:

Your SVG uses font-family: "Helvetica Neue", but your Linux server only has Liberation Sans. The output looks subtly wrong — different letter spacing, different weights, misaligned text.

Why Online Conversion Just Works (When Local Tools Don't)

After going through all those errors, you might wonder: why do online tools handle these conversions so smoothly?

1. Pre-configured environment: Online tools like GuruPDF run on servers with every codec, library, and delegate pre-installed and properly configured. No missing libheif, no wrong ImageMagick policy, no absent Ghostscript.

2. Automatic format detection: The server identifies the actual file format from its binary header (magic bytes), not from the file extension. A PNG disguised as .jpg? No problem.

3. Proper color management: Server-side tools handle ICC profiles and color space conversions correctly, preserving the visual appearance of your images.

4. Memory management: Cloud servers have ample resources and process images efficiently, handling large TIFF files and high-resolution scans without running out of memory.

5. Always up to date: Support for new formats like AVIF and HEIC is added server-side. You don't need to update anything on your computer.

6. No installation headaches: No Python environments, no Homebrew, no DLL hell, no policy.xml editing, no compiling from source.

GuruPDF Image Conversion Tools

GuruPDF supports a comprehensive range of image format conversions, all free and browser-based:

From photos and images:

Vector and specialty formats:

Optimization tools:

Conclusion: Stop Fighting Your Computer

If you've ever spent 30 minutes trying to install libheif on Windows, or wondered why your CMYK TIFF looks green after converting to JPG, or been baffled by a "no decode delegate" error — you're not alone. Image conversion should be simple, but local tools make it unnecessarily complicated.

The next time you need to convert an image, try uploading it to GuruPDF first. It handles every format, preserves quality, and works in any browser on any device. No installations, no error codes, no frustration.

Your time is better spent on your actual work, not debugging ImageMagick delegates.