There's CHDK DNG>CRW option, why not vice versa? - RAW Shooting and Processing - CHDK Forum

There's CHDK DNG>CRW option, why not vice versa?

  • 7 Replies
  • 3818 Views
There's CHDK DNG>CRW option, why not vice versa?
« on: 01 / November / 2011, 12:35:45 »
Advertisements
Since the 'natural' raw format is the simple matrix dump that can be saved as CRW, the DNG file is then produced by CHDK and then saved onto SD card.

In the CHDK menu one can find 'DNG to CRW' option, but there's no way to do it vice versa directly on camera. Is there any reason for it? Or just nobody done it yet? I'd be very interested in this feature, since a few times I forget set DNG support and I have a few, interesting photos in crw.

Athough RawTherepee supports my sx130is's crw I have no love for RawTherapee and UFRaw doesn't work with these files. Also - I think that using dng4ps is rather hypertrophy of form over content, since the feature is already exist in CHDK but it's not accesible from menu.

I could try to add this option to the CHDK menu, but I'm not sure, how the DNG support is done in CHDK. I'm reading sources, but it's not easy (C is not my friend).
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: There's CHDK DNG>CRW option, why not vice versa?
« Reply #1 on: 01 / November / 2011, 15:03:03 »
The DNG code requires the EXIF data to produce the file header (shutter speed, aperture, ISO, white balance, etc).
If you load an old CRW file these are gone and the code has no easy way to get the correct values to put in the DNG header.

It could be done if the JPEG is still available; but would be a lot of work to get the data from the JPEG file.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: There's CHDK DNG>CRW option, why not vice versa?
« Reply #2 on: 01 / November / 2011, 15:11:41 »
I was just writting my 'discoveries' as follows:

Reading the source (dng.c) I found, that the dng creation is really complicated due to whole propcase. I found the convert_dng_to_chdk_raw statment.

Thank you for the answer, you shed more light on the problem. I'll try to read more about JPEG exif, maybe I'll try to born some code...
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

Re: There's CHDK DNG>CRW option, why not vice versa?
« Reply #3 on: 05 / November / 2011, 10:06:49 »
To learn more about exif I'm writing lua script, that extracts exif info from JPEG and writes it in text form on screen or exports it to a file. Just like exiftool on linux.

Nevertheless I'm now interested if exif from JPEG can be directly (binary) copied and pasted in created DNG file? Or DNG has other exif format?

On the internet there is few sites, where exif is well described. And one of worse is exif.org document: http://exif.org/Exif2-2.PDF

It's hard to understand from there some things. Much better is here: http://gvsoft.homedns.org/exif/exif-explanation.html

But I still haven't found answer for my question (JPEG vs DNG exif).
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: There's CHDK DNG>CRW option, why not vice versa?
« Reply #4 on: 05 / November / 2011, 18:10:49 »
You can get the DNG spec from Adobe - http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/products/photoshop/pdfs/dng_spec.pdf

I'm not sure this is something worth adding to CHDK. If you have both the JPEG and CRW files you could do this more easily on your PC.

Also look at the DNG4PS2 program.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: There's CHDK DNG>CRW option, why not vice versa?
« Reply #5 on: 05 / November / 2011, 18:33:40 »
I tried dng4ps2 but I have some problems with it.

The CRW issue is not a big deal - it appears in very rare situations, when I change something and accidentaly not put my cfg file or delete badpixel table. So it's not a thing I could say 'important', it's rather a puzzle;)

Thank you for nice link! I'm also reading the thread http://chdk.setepontos.com/index.php?topic=156.0 where DNG support was first provided. It's awe-inspiring!
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

*

Offline fe50

  • ******
  • 3152
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: There's CHDK DNG>CRW option, why not vice versa?
« Reply #6 on: 06 / November / 2011, 04:13:34 »
@outslider
The TagMe Lua script by user stift may be very helpful for your trip into the world of EXIF meta data with Lua ...  ;)

--> http://chdk.wikia.com/wiki/Lua#TagMe.2C_the_Lua_EXIF_tagger

Re: There's CHDK DNG>CRW option, why not vice versa?
« Reply #7 on: 06 / November / 2011, 04:57:20 »
Woho! Such a great tool! And really nice written code. Thanks!
I'm finding there the same functions I liked to provide:D Seems like I tried to reinvent a wheel...
« Last Edit: 06 / November / 2011, 04:59:37 by outslider »
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

 

Related Topics


SimplePortal © 2008-2014, SimplePortal