Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: Irfanview hangs when trying to print an oversized PNG

  1. #1

    Default Irfanview hangs when trying to print an oversized PNG

    I was trying to print a QR code that was 1600x2078 and when I click on the print dialog it hangs. I keeps trying to do something but the window is non responsive, after about 20 seconds it refresh itself and then hangs again. Basically when the picture is too large it just takes up a lot of CPU and hangs when using the Keep original size option.
    However I "somehow" manage to click on the Fit to page or custom size and reduce the size, then works fine.

    I've tried this on 5 different printers from laserjets to adobe and fax, same results, it isn't printer dependent but some bug with irfanview

    Steps to replicate
    1. Windows 10 64bit with Irfanview 64 bit (4.51)
    2. Use attached PNG file
    3. Print, select Original size
    4. Hang....

    Screenshot with settings and hang showing attached
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Ifranview_Print_Test.jpg 
Views:	13 
Size:	131.4 KB 
ID:	5264   Click image for larger version. 

Name:	Hang.jpg 
Views:	4 
Size:	175.0 KB 
ID:	5265  

  2. #2

    Default

    Oh forgot to mention apart from CPU it keeps taking up tons of memory, after about a minute it had taken up 500MB of memory and still growing. Some kind of a memory leak happening here.

  3. #3

    Default

    Quote Originally Posted by hunnypuppy View Post
    Oh forgot to mention apart from CPU it keeps taking up tons of memory, after about a minute it had taken up 500MB of memory and still growing. Some kind of a memory leak happening here.
    Okay it even hangs on the thumbnails page when trying to read this PNG file

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

    Default

    The attached image is a JPG, not a PNG, and it is not 600 dpi. No image resolution is set. See the image information.

    Try setting it to 600 dpi, then print based on original size.

  5. #5

    Default

    Quote Originally Posted by Bhikkhu Pesala View Post
    The attached image is a JPG, not a PNG, and it is not 600 dpi. No image resolution is set. See the image information.

    Try setting it to 600 dpi, then print based on original size.
    Huh, it was downloaded from https://www.qr-code-generator.com/ (with an active account) and it downloaded as a PNG. Are you saying the extension is incorrect and is that why it's causing an issue?

  6. #6

    Default

    I tried to rename it to .JPG and open it with Irfanview and it said that the file extension was incorrect, it was actually a PNG and it asked me if I wanted to correct the extension.
    So it apparently is a PNG.

  7. #7

    Default

    Okay I see what happened, when I tried to upload the file to this forum, it automatically converted it from PNG to JPG.
    So I've shared the original PNG file here which you can download and check:

    https://www.dropbox.com/s/fp3bvze4vk..._Test.png?dl=0

  8. #8
    Moderator Enterprise User Bhikkhu Pesala's Avatar
    Join Date
    May 2007
    Location
    East London
    Posts
    5,630
    Version
    IrfanView 4.51
    OS
    64-bit Win 10
    CPU Cores
    1

    Default

    The PNG image also has no DPI set. Change it to 600 dpi in the Image Information dialogue and its print size will change to just 3.2 x 2.2 cms. I had no problem uploading a PNG file without it converting to JPG.


    I also printed your original PNG image to a PDF driver without any freezing.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Ifranview_Print_Test_preview.png 
Views:	2 
Size:	47.6 KB 
ID:	5266   Click image for larger version. 

Name:	Ifranview_Print_Test_preview.png 
Views:	2 
Size:	41.5 KB 
ID:	5267  
    Last edited by Bhikkhu Pesala; 06.06.2018 at 11:11 PM.

  9. #9
    Power User j7n's Avatar
    Join Date
    Jun 2006
    Location
    Cyberspace
    Posts
    505
    Version
    IrfanView 4.51
    OS
    32-bit Win Server 2003 SP1
    CPU Cores
    1

    Default

    The PNG file is incorrectly generated. A user of QR Generator should file a bug. The specification says that the resolution unit shall be "meter". PNG is unique this way. This also leads to rounding of PNG resolution 599.99 occasionally...

    The pHYs chunk in this file contains values 72, 72, and 0. Or pixel aspect ratio of 72:72 = 1:1.

    I can confirm bad behavior from IrfanView 4.51, which should be improved. Technically it should treat this file as having no DPI, and assume a reasonable default. Instead it assumes that it has 72 pixels per meter or approximately 2 dpi. It then tries to upsample the image to printer's resolution, consuming large amount of memory.

    An image is very unlikely to have 2 dpi. Maybe a sanity check should be done, and the default radio button switched to best fit, or a warning box presented if original is selected and dpi is very low.

    Paint Shop Pro 7 and 9 treat this image as having no resolution (assume 72 dpi). FastStone Viewer assumes 300 dpi. Photoshop assumes 72 dpi.

  10. #10
    Moderator Enterprise User Bhikkhu Pesala's Avatar
    Join Date
    May 2007
    Location
    East London
    Posts
    5,630
    Version
    IrfanView 4.51
    OS
    64-bit Win 10
    CPU Cores
    1

    Default

    Quote Originally Posted by j7n View Post
    I can confirm bad behavior from IrfanView 4.51, which should be improved.
    I am reluctant to submit a bug-report to Irfan Skiljan as I suspect he will just say that people should fix their own bugs and produce valid PNG images.

    Feel free to submit a report if you think this should be improved.

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
  •