Camera Hacker

: :

Add Comment | Related Links | TrackBack
Related Content

dcraw: name swap?

Dave,

> dcraw dscn0055.RAW
Failed to read metadata from 0055dscn.JPG

I executed the above command, then I got the "Failed to read" message right below it. I know my rename of the file caused this message. But the name "0055dscn.JPG" was what I expected. Seems the "dscn" and "0055" are swapped. Is that normal? Is that what Nikon embedded in the raw file?

Chieh Cheng
Wed, 22 Mar 2006 13:42:02 -0800

Hi Cheng,

Nothing is embedded in the raw file. It's just an array of pixels. Dcraw recognizes the file by its size, exactly 2465792 bytes.

See the parse_external_jpeg() function. If the name of the raw photo ends in ".jpg", add one to the image count to find the JPEG photo.

If the name does not end in ".jpg", swap the two halves of the name and change the extension to ".jpg".

The first rule is for Nikon cameras and the second is for Casio and Pentax cameras. Your file renaming caused dcraw to apply the wrong rule. Here are some examples from my collection:

		Raw photo	JPEG photo

Nikon: dscn3508.jpg dscn3509.jpg
Nikon: dscn4477.jpg dscn4478.jpg
Casio: 0424cimg.raw cimg0424.jpg
Pentax: 0016imgp.raw imgp0016.jpg

Dave Coffin
Wed, 22 Mar 2006 17:31:31 -0800

Add Comment | Related Links | TrackBack
Related Content

Did your message disappear? Read the Forums FAQ.

Add Comment

Spam Control | * indicates required field
Your Name: *
E-mail:
Remember Me!
Comment: *
File attachment is optional. Please do not attach a file to your submission unless it is relevent.
Attach File:
(20 MB Max)
Spam Protection: * Answer of 6 + 7?
Click button only once, please!

TrackBack

TrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites.

Send Ping | TrackBack URL | Spam Control

No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here.

Messages, files, and images copyright by respective owners.