[argyllcms] Re: dcraw outlined, annotated, and un-Dnged

  • From: Elle Stone <l.elle.stone@xxxxxxxxx>
  • To: argyllcms@xxxxxxxxxxxxx
  • Date: Fri, 12 Feb 2010 07:48:31 -0500

On 2/11/10, Michel Joly de Lotbinière <michel@xxxxxxxxxxxxxx> wrote:
> I am no programmer either, but curiosity got the better of me, and I
> let my text editor "beautify" the code copied from Elle's page for
> readability's sake. It gagged at line 6177, in procedure parse_cine(),
> complaining that the "case" keyword was unexpected at this time:
>
>   shutter = get4()/ case 4128: strcpy (model,"H 20");   break;
>
> I then downloaded David Coffin's original dcraw 8.98 and discovered
> that the line contents beginning with "case" actually come from
> another routine earlier in the code file, parse_phase_one(int base),
> which had somehow become mixed into this one--and that there are now 2
> parse_cine() in Elle's modified dcraw.c
>
> Could the conversion to HTML have mixed things up? Maybe simply
> placing the modified dcraw.c without HTML markup on your webserver as
> dcraw-unDnged.c.txt is the way to go... even for those people not
> profiling their cameras with Argyllcms, this commented & modified
> dcraw is interesting.
>
>

Hi Michel,

The words "parse_cine()" should appear twice, once as a function "void
CLASS parse_cine()" and once again when "parse_cine()" is called by
the function "void CLASS identify()".

However, searching the code, I don't find

shutter = get4()/ case 4128: strcpy (model,"H 20");   break;

Rather, I find:

shutter = get4()/1000000000.0;
in function "void CLASS parse_cine()"

and

case 4128: strcpy (model,"H 20");               break;
in function "void CLASS parse_phase_one (int base)"

Just now I compiled and ran the code with several different
approaches, all starting with the code from the web page. I used
Firefox, Edit, Select All to highlight and copy into Leafpad (a text
editor), then saved the entire thing as "firefox.c". I also saved the
page directly as a text file, changed the extension to .c and
compiled, and also tried with opera instead of Firefox. This is all
under Linux - I'm pretty sure as noted in the comments the code won't
work under Windows, though the "road map" would make it easy to modify
the windows version of dcraw.

I will follow your suggestion and post a page with just the code, once
I do some experimenting to see how to minimize/eliminate the impact of
html - this is my very first web page, so it is all new stuff to me.
That HTML thing really does seem like it could cause problems. And
thanks! for giving the code a look.

Elle

Other related posts: