Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Fixed 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:	1
Size:	9.5 KB
ID:	84907
    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, 01:24 AM.

    #2
    This looks like a bug in MS Paint, but I have forwarded the report to Irfan Skiljan.
    Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

    Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

    Comment


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

      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.
      Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

      Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

      Comment


        #4
        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.
        Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

        Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

        Comment


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

          Comment

          Working...
          X