Page 1 of 1

error opening file - (file included)

Posted: Sun Jun 24, 2012 10:54 am
by sklnner
hi all, i have a serious issue (not necessarily with xnview) and i need your help to find the cause

i recently installed windows 7 pro x64 von a new hard drive and i placed some pictures in the Pictures folder and in other folders as well
i installed several windows updates and xnview
i used 'choose default program' (~'always open with') in order to associate some files with xnview on the fly

today i noticed that some of the thumbnails in my Pictures folder (so far only that folder, and only the ones for the bmp files) were empty
i tried to open/view the images but i couldn't, here are the error warnings i got:
windows photo viewer - can't open this picture because the file appears to be damaged, corrupted, or is too large
xnview - warning error reading the file

1) why is it that irfanview and web browers can open this file while windows photo viewer and xnview can't
2) why is the file corrupt and what can have caused that? i read about windows 7 bugs causing file corruption (wow...nice os) but this is very serious bcz i have other files i need

any suggestions are welcome, thank you for your time,
one of the corrupted images: ... es=landing

Re: error opening file - (file included)

Posted: Sun Jun 24, 2012 12:17 pm
by xnview
you can disable option/Read>Ignore read errors

But this file seems to have a premature end of file

Re: error opening file - (file included)

Posted: Sun Jun 24, 2012 12:45 pm
by XnTriq
Welcome to the forum, sklnner (o:

XnView is able to display the file if you go to Tools » Options... » General » Read/Write » General and activate the Ignore read errors setting.

Edit: Ack, Pierre was faster!

You may also want to run the Remove alpha channel command in the Image menu to fix the BMP.

The URL of the link you posted ( is suggesting that ImageShack downsizes the picture.
Could you compress the file and upload the ZIP archive as an attachment to the forum?

Re: error opening file - (file included)

Posted: Sun Jun 24, 2012 2:00 pm
by XnTriq
Other methods I use to prevent XnView from hiding corrupted images in the browser:
  • Tools » Options... » Browser » File List » Misc
    • Deactivate Recognize only by extension
    • Set Scan file headers in folders to Always
I also add certain filename extensions to the second Custom files field, forcing XnView to list these formats even if they're not recognized as images:

Re: error opening file - (file included)

Posted: Sun Jun 24, 2012 6:31 pm
by sklnner
first of all, thank you all for your help and time and tips (which solved the file opening part of the issue), and sry for the delay
atm i don't have the right to upload attachments in the forum but as far as i could see the ImgSh img behaved in the same way and that's why i linked it

now, i understand this is not a win support forum, but my concern was not so much about xnview not opening the files, but about file corruption
you see im in the middle of a transfer to win 7 x64 from win xp x64, on a business workstation with important stuff inside
at first i rejected vista and never used it but now im regretting installing win 7, im having major problems with the smallest functions and it's not a fresh untested os
so, i wanted your opinion on that matter, bcz you know more about image files than anyone else
could this be some minor problem like a random problem while changing file associations or am i dealing with common file corruption which means systemic file corruption caused by the os / the hard drive / the memory?
i understand you are not its, im asking for opinions

again thank you

Re: error opening file - (file included)

Posted: Mon Jun 25, 2012 9:00 pm
by XnTriq
Note: I do have access to PCs running Windows 7, but I'm not a Windows 7 user per se.

I can't think of any scenario where a Windows update would cause file corruption or data loss in BMP images and BMPs only.
What's striking about your sample: It has an alpha channel which is of no apparent use :?
Where did this image come from? Is it a screenshot or an e-mail attachment?

I assume this is one of the hotfixes you were referring to in your initial post:
MSKB ([url=]An update is available to fix a data corruption issue for Secure Digital (SD) cards in Windows 7[/url] wrote:Issues that this update fixes

You have an NTFS-formatted SD card. You use Advanced Direct Memory Access (ADMA) to transfer data between the SD card and a computer that is running Windows 7. However, during this operation, the data on the SD card may be corrupted. Additionally, unexpected problems may occur when you try to use the affected data.

During an ADMA transfer process, the Secure Digital Bus Driver (Sdbus.sys) converts the DMA data structure of the operating system to the ADMA data structure of the SD card. The DMA and the ADMA data structures are also known as descriptor tables. A descriptor table contains a data length value and a buffer address. The data-length field is 16-bit, and it has a maximum size of 64 kilobytes (KB). However, during the data conversion process, the Sdbus.sys driver does not check the buffer size in the descriptor table of the system. Therefore, the Sdbus.sys driver may set an incorrect data length in the SD descriptor table. For example, the Sdbus.sys driver may set the data length to something longer than 0xFFFF. Also, I/O corruption occurs, in this scenario. This, in turn, causes data corruption.

Re: error opening file - (file included)

Posted: Mon Jun 25, 2012 9:26 pm
by MaxSt
Byte 0x000A in this file is 0x3A, which is incorrect. It should be 0x36.

Change it to 0x36 and you will be able to open the file in XnView.

Re: error opening file - (file included)

Posted: Tue Jun 26, 2012 4:00 am
by XnTriq
MaxSt wrote:Byte 0x000A in this file is 0x3A, which is incorrect. It should be 0x36.
Thanks! Very interesting, MaxSt :D

Does this mean that some program saved the BMP with a wrong color depth info (24- vs. 32-bit) in the file's header?
Do you know a utility like JPEGsnoop or TweakPNG for BMPs?

Re: error opening file - (file included)

Posted: Tue Jun 26, 2012 5:02 am
by MaxSt
XnView supports 32-bit in BMP.

0x36 is the correct size of the BMP header (54 bytes).

You can see it in the Example 1 in that article:

Re: error opening file - (file included)

Posted: Thu Jun 28, 2012 1:15 am
by XnTriq
MaxSt wrote:XnView supports 32-bit in BMP.
Yes, I'm aware of that. It's just that I expected the all-white alpha channel to be gone after fixing the bitmap's header with a hex editor, but it's still there.

Dave Johnson29 (Sawmill Creek Woodworkers Community » [url=]FREE software for .BMP Header info.[/url]) wrote:Hi All,

As promised in the

There is a FREE program for displaying the actual header information for a Windows .BMP file. Go to my website and click the Software link.

If you read posts #18 ... stcount=18
If you read posts #20 ... stcount=20
If you read posts #23 all will become clear. ... stcount=23

I hope this helps save messing up picture details when there is no DPI information contained in the file. I will try and add other file headers (if they have them, some do some do not) as time comes available.

Re: error opening file - (file included)

Posted: Thu Jun 28, 2012 2:00 am
by XnTriq
David Tribble ([url=]Programs[/url]) wrote:bmpdump.exe
Dumps the contents of a BMP bitmap image file in hexadecimal form.
[source code]
WinDiff of bmpdump's output:
  • Image

Re: error opening file - (file included)

Posted: Tue Jul 10, 2012 6:53 am
by sklnner
hi, i apologize for the absence from my own thread
we are upgrading and i had no internet access during the last days

first of all, as it's been already stated, the symptoms of the problem have been dealt with, in various ways
1: xnview opens the files using the ignore errors setting and most importantly 2: saving the files also fixes the files permanently
XnTriq wrote:I can't think of any scenario where a Windows update would cause file corruption or data loss in BMP images and BMPs only.
as i said/wrote, i didn't know if the bmps were the only corrupted files
that's why i feared of generalized file corruption and came here to seek help (and not bcz of these unimportant images)
but indeed, thus far i haven't found any other malfunctioning files and the system doesn't seem to be having any issues so it should be just these bmps
XnTriq wrote:What's striking about your sample: It has an alpha channel which is of no apparent use :?
Where did this image come from? Is it a screenshot or an e-mail attachment?
the images were downloaded from the internet after a windows 7 installation (i though i should get some wallpaper images with the upgrade)
they were not modified or edited and the only actions affecting them would be 1 windows thumbnail procedures and 2 personalize/wallpaper procedures
EDIT: the images were fully functional in opening, in thumbnails, in desktop as wallpapers

in any case i 've come to believe that indeed the only files affected were these images which means the problem is minor and academic
now that we know what's the problem with the file (btw thank you.. - at first i was researching the problem by myself but since i didn't know the procedural terms, i couldn't find what kind of programs i must use to get the bmp data i read about on some wikipedia articles), can we tell if this could be caused by thumnail / personlize / or file association procedures? i don't know much but i can't see why these procedures could modify the files in anyway
there are other image programs installed, but they have nothing to do with these images
again thank you very much for your help

ps: no the articles i was referring to, were describing stationary windows 7 hard drive files getting corrupted - not files getting transferred from an SD card, but i found some misconceptions in these articles, the official ms article was not referring to a stable windows 7 release

Re: error opening file - (file included)

Posted: Wed Jul 11, 2012 2:00 am
by XnTriq
:? For lack of a better answer, here's what I've found searching for “windows 7 file corruption”:
Windows 7 Forums ([url=]Windows 7 - File Corruption issues[/url]) wrote:Wonderful Microsoft Security Essentials is causing the issue. I have to shutoff realtime protection in order to use/download/copy any zip or self extracting file and have it be usable on the computer.
Vista Forums ([url=]Corruption of Images on Thumbnail View[/url]) wrote:Recently, I have ended up with damaged and/or destroyed JPEG images due to the thumbnail icon feature and/or Photo Gallery. The condition can be created as follows:

1. Browse to a folder containing JPEG images.
2. Do nothing... as Vista generates the thumbnails, it struggles, and only "half" of it is created (see below).
3. When the image is opened, it is corrupted.

My understanding is that generating a thumbnail should not alter the original image in anyway. However, a thumbnail that was generated fine once before for an image that was fine once before...
Vista Forums ([url=]Re: Corruption of Images on Thumbnail View[/url]) wrote:I am experiencing the same problem. I was viewing thumbnails of JPG files over a network share, opened a few within Windows Photo Gallery - and on close (clicking the X) Photo Gallery corrupted the files. I am using Vista Home Premium 64bit SP1. I have been looking all over the forums for an answer - and although I have seen posts dating back to the release of VISTA, I have seen no solutions. I am afraid to use the VISTA machine to look at photos as the corruption occurred when the original files shouldn't have been altered at all (closing a file should not equal a file save).
Microsoft TechNet Forums ([url=]Getting ERROR_FILE_CORRUPT when moving a file... Result: Chkdsk at reboot (Reproducable and confirmed)[/url]) wrote:This is a known regression in Windows 7 in the NTFS file system. It occurs when doing a superceding rename over a file that has an atomic oplock on it (atomic oplocks are a new feature in Windows 7). The indexer uses atomic oplocks which is why it helped when you disabled the indexer. Explorer also uses atomic oplocks which is why you are still seeing the issue. When this occurs STATUS_FILE_CORRUPT is incorrectly returned and the volume is marked "dirty" which is a signal to the system that chkdsk needs to be run. No actual corruption has occured.
Are these hotfixes installed on your system?

Re: error opening file - (file included)

Posted: Fri Jul 13, 2012 2:18 am
by sklnner
surpsiringly my unreasonable guess (by exclusion) seems to be possible
i did some more research trying to distinguise the similar but different windows file corruption issues reported all around the internet
indeed there seems to be an image specific corruption issue but i have to the conclusion that it is isolated to the pictures library and folders
in all the other reports i read about, the users were using these default directories
i on the other hand, besides the wallpapers stored in the my pictures folder, have about 30 thousand images in a separate personal folder and i have not encountered any problem yet (hopefully i will not in the future either...)
the problem is not general data corruption therefore and i don't think it is been caused by thumnail creation either, bcz the thumnail have been generated for my personal folder too
so now, my guess is that it has to do with windows photo viewer, personalize, or the pictures library complicated functions and abilities
the problem resides somewhere over there
i believe the hotfixes you quoted are all applied atm, but i don't know at which point they were applied, before or after the problem
anyway case closed, i don't see if there is nothing we can do besides describing the issue
hopefully i haven't just wasted your time for nothing and other ppl who come accross the same problem will get some additional information
again thnx for your help