Results 1 to 5 of 5

Thread: Crop PNG in Paint -> Decode error / Invalid or unsupported PNG file

  1. #1
    IV Newbie
    Join Date
    Mar 2017
    Posts
    2
    Version
    IrfanView 4.44
    OS
    64-bit Win 7 Professional SP1
    CPU Cores
    4

    Default Crop PNG in Paint -> Decode error / Invalid or unsupported PNG file

    Thinkpad W520, Windows 7 64bit, Irfanview 4.44 64bit, and
    Thinkpad T61, Windows 7 64bit, Irfanview 4.44 32bit.

    Problem: After cropping .png image in Paint, Irfanview does not display the image, and gives popup error.

    I had this problem for a long time. And on multiple installations, drives (hdd) and computers with Windows 7 64 bit. Current computer use ssd for OS, hdd for storage. In the following, the image is stored on hdd.

    1. Go to https://www.google.com/patents/US3115581
    2. Download first image (png) by clicking on it to view in browser, then drag&drop to Explorer folder.
    3. Open in Irfanview by double-clicking file (default image viewer). This works. Close it.
    4. Open png image in Paint by right-click edit (default image editor).
    5. Crop image by using rectangular selection (select smaller area), right click, Crop. Save and close.
    6. Open in Irfanview by double-clicking file. => Black background in Irfanview with popup window:

    <path\file name> : Decode error !
    Invalid or unsupported file.
    Click image for larger version. 

Name:	2017-03-20_01-15-51.png 
Views:	293 
Size:	9.5 KB 
ID:	4730
    Close error window and irfanview.

    7. Open same image in Windows Photo Viewer. Confirm success.
    8. Open same image in Microsoft Office Picture Manager. Confirm success.
    9. Open same image in Irfanview. Confirm error (again).
    Last edited by dukof; 20.03.2017 at 12:24 AM.

  2. #2
    Moderator Enterprise User Bhikkhu Pesala's Avatar
    Join Date
    May 2007
    Location
    East London
    Posts
    6,440
    OS
    64-bit Win 10
    CPU Cores
    1

    Default

    This looks like a bug in MS Paint, but I have forwarded the report to Irfan Skiljan.

  3. #3
    Moderator Enterprise User Bhikkhu Pesala's Avatar
    Join Date
    May 2007
    Location
    East London
    Posts
    6,440
    OS
    64-bit Win 10
    CPU Cores
    1

    Default

    As I suspected, this is a bug in MS Paint.

    Quote Originally Posted by Irfan Skiljan
    Newer IrfanView versions use a new LibPNG with strict(er) checks for buggy header and chunks.
    => there is a problem with the PNG header entries.

    In order to avoid errors and overflows, IrfanView will stop.

  4. #4
    Moderator Enterprise User Bhikkhu Pesala's Avatar
    Join Date
    May 2007
    Location
    East London
    Posts
    6,440
    OS
    64-bit Win 10
    CPU Cores
    1

    Default

    Quote Originally Posted by Irfan Skiljan
    OK, I checked the file and found the cause
    => bad length for the "background" PNG chunk (2 bytes set, required 6) => error in the save program.

    and I added an exception for this case => the file will be loaded in the next IrfanView version
    I have therefore changed the thread status to Fixed, as future versions of IrfanView will be able to load buggy files like this.

  5. #5
    IV Newbie
    Join Date
    Mar 2017
    Posts
    2
    Version
    IrfanView 4.44
    OS
    64-bit Win 7 Professional SP1
    CPU Cores
    4

    Default

    Quote Originally Posted by Bhikkhu Pesala View Post
    future versions of IrfanView will be able to load buggy files like this.
    Great! Much appretiated!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •