Correction for the faulty raw files of 40D 1.04 available
I wrote a small program for the correction of faulty CR2 files created by the firmware 1.04 version of the 40D. The error in the raw file causes ACR to reject the file, but DPP is less picky.
The program runs only on Windows machines (actually, it is a console application).
It can be downloaded from
It can be started in a DOS window or in Run. It does not change the input file, rather it creates a copy with the small correction.
The input file name (the faulty raw file) is the first parameter, and the name of the corrected copy is the second parameter.
The program makes the change only if the MakerNote is in fact faulty, so if started with a proper CR2 file, no update takes place (although a copy will be created anyway).
Mark Lord wrote:
Okay, your program seems to change just the MakerNote (?).
Exactly what does it do?
It corrects the error in the MakerNote IFD, which causes ACR and Adobe DNG Converter to abandon the processing of these files. It is a tiny issue, but big enough for ACR.
Have you posted this on the Adobe forums?
what is this new firmware meant to address and i can not see it anywhere to download it
Very interesting that they don't seem to mind your site being in your signature, but maybe they're just blocking anything with an "EXE" on the end in case it's some sort of evil.
I'll bet you could wrap it in a ZIP - or simply change the extension - and it'd fly
Anyhow, I wonder if you could send me an email with some details about what you're doing and I could look into making a front end for your program or making a full stand-alone version in Visual Basic to give people an interface that would allow them to convert folders full or perhaps selected files from folders full of these faulty files.
Actually, now that I think about it, maybe all I need is a sample 1.0.4 RAW file to use to test. I suspect shelling to your program would be the easy/lazy way for me to do this anyhow.
If I had a newer 40D that had this firmware, and if I was using Adobe's RAW converter, I might want an easy way to batch convert whole masses of these.
I suspect we can expect to see 1.0.5 very soon indeed, but meanwhile people will be amassing more and more of the defective files that they may want to modify in the future. Perhaps Canon will eventually offer a repair tool too. Then again, maybe they're just messing with Adobe
I'm guessing that your camera has 1.0.3, so you probably can't tell me what's been improved or changed (other than this) with 1.0.4.
actually, that's where I saw this problem. Someone complained about his files not being accepted by ACR; I asked for a sample analyzed it.
However, this is not an issue of Adobe. The raw file is clearly erroneous, and that is Canon 's responsibility alone.
1. I downloaded the faulty raw file from here (there was only one file there):
2. The error is caused by plain sloppyness of the firmware programmer. One field ("tag") has been removed from a directory (this is within the raw file, it is called Image File Directory) and the number of entries has not been corrected. This leads to a formal error, which can be simply ignored, like DPP is doing, or a program may think that it is a serious error, like ACR is doing.
3. I have zero problem if you want to make a UI to the program, but I don't think it is warranted. This version has obviously been recalled, so there are not many cameras out there with it.
Plus, if someone has many files, it is very easy to create a redirected directory list and edit it, so that each file becomes a command.
Another option would be to temporarily change Windows Explorer's action for opening files with the CR2 extention.
If I saw real need, I would modify the program, so that the output file name gets deducted from the input file name (if there is no output specification) to make the mass conversion easier (though the same can be achieved by changing the "open" action of Explorer in the folder options).
However, until now I have seen TWO people with such problem - and one of them (the originator for my action) is using a Mac (so, he can't use this program without moving his files to another machine).
Honestly, I created this program only to have a skelaton for such actions, which I will be able to modify in minutes to correct something else. More about that only in email.
I like your idea of just setting Explorer to open with your program instead of whatever else it might have been using. That's fast and easy and gives you that "Explorer view" to work from which is just about what I'd have been doing anyhow.
Sounds good to me, and whatever I did wouldn't work on a Mac either
Like you say, it appears that there are not a lot of 1.0.4 cameras out there so perhaps Canon is rethinking this and the newer version will be out soon.
I guess I'm one of the unlucky ones. I just bought my 40D today and it has firmware 1.04. I wonder how many more 40D's with 1.04 are now out there? I ran into the CR2 issue earlier this afternoon trying to process my first set of shots with Adobe Photoshop Lightroom. None of them would open. I came on here and was happy to see Gabor's command-line Windows app that fixes the tag. It does work. A version that works in batch mode fixing all CR2's in a directory would definitely be helpful, especially when I go a long shoot and come back with a couple hundred or more CR2 that need to be fixed. I tried changing the default program for CR2's in Windows Explorer, but that doesn't work. Maybe because the command-line app requires the filename input parameter?
I hope Canon comes out with a fix for this very soon, or at least make 1.03 available for download so I roll my 40D back to the previous version.
1. Windows Explorer, Tools, Folder Options, File Types
2. Select CR2 (add it if it is not defined yet)
4. select "open" from the actions, click on edit (do not select the edit action!)
5. you probably see PS in the application field; copy it and paste it to somewhere, so that you can easily reinstate it later
6. Replace the string with "program path and name" %1 %1.new.CR2
7. Finish the change in the Tools.
8. Select all files and hit Enter. Wait a few sec (or more if you have many files). The corrected files will appear one by one in the Explorer list.
They are called "whatever.CR2.new.CR2" (or as you like it). Changing their names is very easy in a BAT file with ? in the REN command.
Another, perhaps easier alternative is, that you don't add "new" or whatever to the filename, keep it unchanged, but add a different path to it.
Unfortunately this procedure won't work in Vista. When changing the default program associated with a filetype, there are no advanced options for specifying input parameters like XP gives you.
For Vista, in the Control Panel, there is a CP applet called Default Programs. It does not provide a means of adding extra opening options (Edit, Print, etc) as you could with XP, but does allow changing the default Open option.
Mark Lord wrote:
So basically, your program just changes the value 0x24 to 0x23 at
offset 0x2ec in the RAW file. Right?
The location is fix with this camera and this firmware version . I don't go blindly on the file and change a value more or less randomly. The program goes through the TIFF structure and verifies, that this is the targeted case.
I uploaded a new version. If you specify only one parameter, the input file name, then the output file name will be the input name with CORR added at the front of the file extention. For example IMG_0123.CR2 will be IMG_0123_CORR.CR2
The Default Programs > Set Associations applet in Control Panel is where I was trying to set the Open options. It'll let me browse to CR2CORR1.EXE and set it as the default application for the CR2 filetype, but that's it. I don't see anywhere where it'll let me specify input or output parameters for the app when it executes.
For Vista, in the Control Panel, there is a CP applet called Default
Programs. It does not provide a means of adding extra opening
options (Edit, Print, etc) as you could with XP, but does allow
changing the default Open option.
|Sophisticated construction by the nature by Orchideon|
|After the Rain by Flor Tempra|
from Macro - Something Pink
|Asilah by Limburg|
from Cozy Corners