Jump to content

Unable to load image and error is uninformative


mkidd
 Share

Recommended Posts

When I try to load a certain PNG image in Paint.NET 3.36, I get the message "There was an error opening the file." without any further details. The image opens fine in Windows Picture and Fax Viewer (WPFV), Microsoft Office 2003 Picture Manager, IrfanView (4.10), Photoshop 5.5, and Matlab.

The image file is about 1.4 MB, which exceeds the 256 KB limit imposed by the forum software, but I would be happy send it by other means.

The only obviously peculiar thing about the file is that it has the exact same data on each image plane, i.e. it is a grayscale inefficiently stored in an RGB format.

This PNG was created from a 24-bit TIFF file using WPFV. Paint.NET could not load the TIFF file either, although all the other applications cited above could. Curiously though, if I convert the TIFF to BMP using WPFV, Paint.NET can read the BMP file. And more bizarrely, I can load the PNG into Photoshop and save it again a new PNG file using the default PNG save options (Interface: None / Filter: Adaptive) and then read the resulting smaller (1099 KB) file into Paint.NET successfully. Other Photoshop save options, e.g. None/None or Adam7/Adaptive also yield PNG files that Paint.NET can read.

Link to comment
Share on other sites

The image file is about 1.4 MB, which exceeds the 256 KB limit imposed by the forum software, but I would be happy send it by other means.
You can package the image into a ZIP file, then upload to an online host such as MediaFire. Provide the link and let us have a gander.

At the moment, to me it does sound peculiar indeed. I cannot speak for other users here, but having the image to examine would be the best option right now.

Link to comment
Share on other sites

This is truly puzzling. Does this occur only with this one image, or with others too?

The only 'fix' I can suggest is to resave it another application if you are wanting to edit it in Paint.NET. If there is a silver-lining to this black cloud, it's that the image can be opened elsewhere, hence I would do so.

I cannot shed any more light on this, perhaps someone else could...?

Link to comment
Share on other sites

I think I figured this one out. If I remove the pHYs chunk from PNG file (in my case using a hex editor), Paint.NET loads the image fine. That means removing this sequence of bytes starting at file offset 0x6a.

00 00 00 09 70 48 59 73 00 00 00 00 00 00 00 00 01 ea 65 16 a4

The first long int (00 00 00 09) specifies the chunk data size. The next four bytes (80 48 59 73 = pHYs) specify the chunk type and the final long int is a checksum. According to the PNG 2.1 specification, the chunk data itself specifies the X and Y pixel dimensions, (long ints) either as an aspect ratio (if last byte is 0) or pixels / meter (if last byte is 1). The data in the problematic file translates to 0 pixels / meter in each dimension. The standard does not address how 0 should be treated, which presumably results in to library dependent behavior. My understanding is that Paint.NET uses .NET libraries for loading images and they may be taking a strict view on the matter and throwing an exception, literally or figuratively.

Most PNG files simply do not include the pHYs chunk in which case the standard directs decoders to assume a 1:1 aspect ratio, i.e. square pixels.

I think the software for the scientific camera we are using wrote a slightly invalid TIFF file, i.e. one with the pixel aspect ratio explicitly defined as 0:0. Photoshop probably saw this explicit definition and blindly mapped it to the pHYs chunk.

Link to comment
Share on other sites

  • 1 year later...

Hello,

I am suffering this same problem, last night printed off a drawing (the desktop I was working on was sized to A3 to match the required print out) then saved and closed the drawing, remembered I needed a 2nd copy so attempted to re open the file without success.

When I clicked properties it showed file type as 'file' and the size as '804kb', I cant save it to a different format as it wont open, tried renaming it with extensions like .jpeg, .png etc and opening in other programs but the cant open it either.

Ugg :(

Help

R.

Link to comment
Share on other sites

The file from ray-logic (http://www.mediafire.com/?zymyn2lm1ui) with the .png extension is not a PNG file but rather what appears to be a PDN file which mistakenly has the .png extension. The first four characters of the file are 'PDN3'.

When opened in Paint.NET 3.5.2 it also generates the unhelpful "There was an error opening the file." message though the reason is much more straightforward than the case that started this thread.

Link to comment
Share on other sites

Thank You. :)

R.

Ps. Arrgghh The mediafire link dont seem to do anything..

PPs. It says the file has been removed. Any chance you could put it up again

Resolved - Firefox blocked some add on which needed installed to allow the download, normal internet explorer allowed it to be downloaded.

A big thank you.

R.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...