Error 2 loading file (may be corrupted or unsupported file format), whilst the file loads fine in Windows Photo-Viewer

Post your questions, bug reports and feature requests here
Post Reply
User avatar
Levien
Posts: 14
Joined: Fri Sep 13, 2024 1:29 am

Error 2 loading file (may be corrupted or unsupported file format), whilst the file loads fine in Windows Photo-Viewer

Post by Levien »

Hi Again GBP,

I am currently running a screensaver with a lot of memes in them.

And I noticed that from a particular folder I get a lot of error messages saying:
Error 2 loading file, this file could be corrupted or something alike
Now I configured a screensaver to just run that particular folder. And checking the error log, I can see their filenames and extension. But whenever I search for the file in windows explorer, in that folder, I get the image to show up, but it loads perfectly fine in Windows Photo-viewer. I do a lot of editing of memes with just the basic windows 10 photo editor (like cropping and erasing watermarks and stuff like that, and then just usually click the save button.)

The error log looks something like this, after having it let run for about 2 minutes (I made a 5 bar divider, so it displayed a lot of images at once as the entire folder contains about 380 files, i thought I sift through them real quick, and see what the error was all about.

Already did a hard-drive scan (they are stored on an m.2 drive, and both the smart and sector scan gives me no bad sectors or readouts). And the images load fine in the windows photo viewer.

Any idea what is going on here? They are all just .PNG files, which should be supported?

The error log looks like this:
16-10-2024 15:22:13 :ER: Command Line: /s "G:\__TELEVISION\Screensavers\2024\DISCORD FILTER.gss"
16-10-2024 15:22:13 :ER: Error 2 loading file=M:\_IMAGES\__DISCORD\_MEMES TO BE POSTED\5a07aa4f5240ab4f81f7506882534a6f.png
16-10-2024 15:22:18 :ER: Error 2 loading file=M:\_IMAGES\__DISCORD\_MEMES TO BE POSTED\8ef3b61743d6182809724760af8d874c.png
16-10-2024 15:22:57 :ER: Error 2 loading file=M:\_IMAGES\__DISCORD\_MEMES TO BE POSTED\__POSTED DISCORD MEMES\a39fe9b68886ee2b9b4cb36c0868ddbe.png
16-10-2024 15:23:18 :ER: Error 2 loading file=M:\_IMAGES\__DISCORD\_MEMES TO BE POSTED\98aa15354e158545477379b8b07a2b0f.png
16-10-2024 15:23:31 :ER: Error 2 loading file=M:\_IMAGES\__DISCORD\_MEMES TO BE POSTED\72f63d101585d836490241307f502aa2.png
16-10-2024 15:24:1 :ER: Error 2 loading file=M:\_IMAGES\__DISCORD\_MEMES TO BE POSTED\8dd848254dda8ca8a5f8eaa99102c20c.png
As an example, i will show you that the last image loads up fine in the windows photo viewer (double check the file name to see that it actually the image giving the error.

Could it be that the editing with the windows Photo-Viewer is causing an issue here? Or could be the crop settings on the Photowall?

Error Display Message
gPhotoShow Display Error.JPG
gPhotoShow Display Error.JPG (14 KiB) Viewed 7440 times
Hard-Drive sector Scan
Sector Scan.JPG
Sector Scan.JPG (432.83 KiB) Viewed 7440 times
Last Image showing no signs of corruption, as it loads perfectly fine?!
Last Image File displaying correctly in the Windows Photo-Viewer.JPG
Last Image File displaying correctly in the Windows Photo-Viewer.JPG (170.39 KiB) Viewed 7440 times
Looking forward to your input, don't know what's going on here, it only does this with pictures from this directory which I edited with Windows Photo-Viewer...

Thanks!

Kind Regards,
Levien
User avatar
gpb
Site Admin
Posts: 944
Joined: Mon Dec 19, 2011 1:23 am

Re: Error 2 loading file (may be corrupted or unsupported file format), whilst the file loads fine in Windows Photo-View

Post by gpb »

Hello,
the most likely thing is that the file despite having a .png extension is not a png but another format not supported by gPhotoShow
It is also possible the file is corrupted in a way that other programs load it but gPhotoShow fails. This happened in the past with lots of jpeg files with corrupted exif tags
Without a file to analyze It is not possible to give a more precise answer
Gianpaolo Bottin
gPhotoShow.com
User avatar
Levien
Posts: 14
Joined: Fri Sep 13, 2024 1:29 am

Re: Error 2 loading file (may be corrupted or unsupported file format), whilst the file loads fine in Windows Photo-View

Post by Levien »

Hi!
Thanks for your quick response.

I attached a few images that came up in the error log. I think the forum has a max attachments setting of 3, so I just grabbed 3 of the ones that we're reported by the error log. Anything you can extract from that?

As a solution, and part of the trouble shooting:
1: I will try to copy the folder to another drive, and run it from there (as to make sure it's not harddrive drive related, seems not to be the case, because windows Is located on that exact same drive, I just made a partition with all the free space left, to run the SlideShows as this is one of the two m.2 drives I have in my system it seemed smart to run of an m.2 as they are the fasted at indexing and loading), See if that fixes the issue, if it does, it is probably drive related, which would be a major bummer, but the OS is pretty stable and usually have the system up and running for days or weeks at t a time.
2: I will probably "Batch Process" the entire folder through Photoshop. Make sure they are saved all in the same way, perhaps whilst running that batch process Photoshop will report errors as well. If the batch is done, without any Photoshop errors, I'll try to run the screensaver again and see if it stops displaying this error. If that works, I know I have to create a buffer folder as where I "batch process" all my files before placing them into a slideshow folder.

Note most if not all these images come from the TikTok "Save Video" > Select all Photo Function. So don't know how that process works, aned how it is taking care of exifs tags and extensions. They mostly come in as .PNG files though

Will try to keep you posted on the test I conducted. In the meanwhile I attached some images for you to explore and might see if you can find anything weird about them. For now my mom is coming over to cook her famous real Deutsche Currywust :D, so I am going to enjoy that first, and then dive into the testing of these solutions I think might help to rule out, or solve the issue entirely.

Note whilst trying to provide you with the "corrupted images" I got the following message from the boards, So I can't even upload them to you, that's kind of a red flag in itself already indeed. I could mail them perhaps, or host them on my MedieFire, so you can have a look?
Uploading to board failed.JPG
Uploading to board failed.JPG (110.13 KiB) Viewed 7434 times
User avatar
Levien
Posts: 14
Joined: Fri Sep 13, 2024 1:29 am

Re: Error 2 loading file (may be corrupted or unsupported file format), whilst the file loads fine in Windows Photo-View

Post by Levien »

For now I did a quick upload of 4 affected images contained in a .RAR archive hosted on my personal MediaFire account.

The download link is the following:
https://www.mediafire.com/file/wt62egnp ... s.rar/file

Hope you are able to examen them and see what's going on.)

Just tried opening the affected file in Photoshop, and it gave me an error: "Not a PNG file", and than just left me with a blank Photoshop session, So the batch processing will not work either...

Any suggestions on how to isolate these affected files automatically (otherwise I will run the Slideshow once and copy the files from the error log) one by one and do the following, re-open and re-save them manually in a program like paint. As I just tried opening the affected files in Paint, and then just resaving them as a PNG, then they are able to be opened by Photoshop, so they shouldn't be "corrupted" at that point.

And yeah don't mind the text on the memes, trying to create a sort of mental health grow slideshow for Discord Streams.
User avatar
Levien
Posts: 14
Joined: Fri Sep 13, 2024 1:29 am

Re: Error 2 loading file (may be corrupted or unsupported file format), whilst the file loads fine in Windows Photo-View

Post by Levien »

For now I did a quick upload of 4 affected images contained in a .RAR archive attached as a forum attachment.

Hope you are able to examen them and see what's going on.)

Just tried opening the affected file in Photoshop, and it gave me an error: "Not a PNG file", and than just left me with a blank Photoshop session, So the batch processing will not work either...

Any suggestions on how to isolate these affected files automatically (otherwise I will run the Slideshow once and copy the listed files from the error log) one by one and do the following, re-open and re-save them manually in a program like paint.

I just tried opening the affected files in Paint, and then just resaving them as a PNG, then they are able to be opened by Photoshop, so they shouldn't be "corrupted" at that point.

And yeah don't mind the text on the memes, trying to create a sort of mental health grow slideshow for Discord Streams :P .
Attachments
CORRUPTED PNG examples.rar
(152.69 KiB) Downloaded 89 times
User avatar
gpb
Site Admin
Posts: 944
Joined: Mon Dec 19, 2011 1:23 am

Re: Error 2 loading file (may be corrupted or unsupported file format), whilst the file loads fine in Windows Photo-View

Post by gpb »

The files you uploaded are in webp format, gPhotoShow can load them but not with the library it uses by default. Normally you should rename them webp and add the webp extension in gPhotoShow "Images" page (Additional file extensions)
But there is a faster way, just tick the option "Enable color management" in the page Images->Display Options
When that option is active gPhotoShow uses another library that also supports webp files
Gianpaolo Bottin
gPhotoShow.com
User avatar
Levien
Posts: 14
Joined: Fri Sep 13, 2024 1:29 am

Re: Error 2 loading file (may be corrupted or unsupported file format), whilst the file loads fine in Windows Photo-View

Post by Levien »

gpb wrote: Wed Oct 16, 2024 6:18 pm The files you uploaded are in webp format, gPhotoShow can load them but not with the library it uses by default. Normally you should rename them webp and add the webp extension in gPhotoShow "Images" page (Additional file extensions)
But there is a faster way, just tick the option "Enable color management" in the page Images->Display Options
When that option is active gPhotoShow uses another library that also supports webp files
Hi!

Thanks you kindly for this info and solution!

The "enable color management" completely resolved the issue. Not getting any more errors! Jeej :D

May I ask how you we're able to determine that these where infact webp images? I checked the file data under "properties > details" of these images but could not retrieve any info that they where in fact webp images. I however did add the .webp format under "additional file extensions", but that was already the case when I got these errors, so it's not that option that is related to this problem. As with only that option enabled it was giving me the initial errors. So somehow these are .webp images disguised as .PNG. Never had any issues with pure and real .webp images when I added them under the "additional file extensions"option, so for pure .wepb images the "additional file extension" option works fine!

Just wondering how these webp. images could end up having a .PNG extension. I am a bit confused.

But at least I am glad it's working now with the "Enable Color Management" setting enabled. Saves me a lot of hassle.

However I would like to fix the problem at the root of the issue, and actually re-save the .webp disguised as .PNG images, to either the original webp format, or a new non corrupt .PNG format.

Any suggestions on how to automate such a task? Even if it's just for automating and grabbing all the corrupted files, so I can copy them to separate folder, and having to re save them manually (wouldn't be much of an issue, as I am used to these kind of tasks, processing 100's of images 1 by 1 by hand. :P )

Thanks anyways already! You've been a great help, and thanks for resolving the issue!

Have a lovely day, and thanks for helping me out! I still need to reply to the earlier topic I posted, will do that asap!
User avatar
gpb
Site Admin
Posts: 944
Joined: Mon Dec 19, 2011 1:23 am

Re: Error 2 loading file (may be corrupted or unsupported file format), whilst the file loads fine in Windows Photo-View

Post by gpb »

Levien wrote: Wed Oct 16, 2024 6:54 pm May I ask how you we're able to determine that these where infact webp images?
I am using XnView MP as file viewer, its properties window displays file type
xnviewmp_qYqCJTJaeK.png
xnviewmp_qYqCJTJaeK.png (94.8 KiB) Viewed 7422 times
Levien wrote: Wed Oct 16, 2024 6:54 pm However I would like to fix the problem at the root of the issue, and actually re-save the .webp disguised as .PNG images, to either the original webp format, or a new non corrupt .PNG format.

Any suggestions on how to automate such a task?
I don't know if it is possible to automate the task, anyway with XnView should not be too difficult to find webp files and rename them
Gianpaolo Bottin
gPhotoShow.com
User avatar
Levien
Posts: 14
Joined: Fri Sep 13, 2024 1:29 am

Re: Error 2 loading file (may be corrupted or unsupported file format), whilst the file loads fine in Windows Photo-View

Post by Levien »

Hi Gpb!

I just wanted to post an update on this topic and give you a tip on how to fix the False .PNG files that are actually .WEBP images in disguise automatically and batch the entire process.

I just found a program called XnConvert. Which will let you convert any and entire image / Folder / Sub folder structure, by replacing the extension of the files automatically.

It will preserve the entire folder and sub folder structure, and you can select "Delete Original File" in one of the options. I currently just batched 1000 .WEBP images to .PNG. And whenever I open these batched files Photo Editor (it let's me edit them, save them, which you cannot do for .WEBP images). When it's saved from inside the windows photo editor as the .PNG it's converted to, it opens up fine in Photoshop, not giving the "This is a not a .PNG file" error.

So I am going to run this program over my entire affected folder I talked about before. Just so they are all true .PNG files.

The program is free, and can be downloaded here:
https://www.xnview.com/en/xnconvert/

Hope that helps anybody encountering the same issue...

At least now and with this the problem is addressed at it's core, and finally found a solution to replace all the files to true .PNG files automatically...

Just wanted to let you know, and make you and or anybody else aware of this Program.

Have a great day! And thanks for your awesome program gPhotoShow Pro!

Kind Regards,
Levien
Last edited by Levien on Wed Nov 13, 2024 12:12 am, edited 1 time in total.
User avatar
Levien
Posts: 14
Joined: Fri Sep 13, 2024 1:29 am

Re: Error 2 loading file (may be corrupted or unsupported file format), whilst the file loads fine in Windows Photo-View

Post by Levien »

Okay, So I just Batched the entire affected Folder/Subfolders with the "Delete Original File" option selected, and saved them all as a .PNG. It batched 461 images, that are now all true .PNG files. I de-selected "Enable Color Management" from the gPhotoShow options, and no longer getting any errors.

So just wanted you to let you know, this method works really, really well, at it's core! No manual browsing and saving each image by hand.

This tool is such a life saver, AND the problem is now actually addressed at it's core...

So very happy with that!

Cheers!

Kind Regards,
Levien
Post Reply