Monthly Archives: February 2005

iLife ’05, iPhoto 5.0.1 and Canon PowerShot G3 RAW files

Update: This is now no longer required when using OS X 10.4: noted here

Well, I’ve given up sulking about iPhoto 5 not supporting my G3 RAW files, fixed it myself, and am now really annoyed at Apple for being so lazy. Basically, the fix means changing the camera ident string in each .CRW file to say G5 instead of G3 – what a totally pointless and trivial change that a slightly expanded set of test strings within iPhoto would have cured from the outset. I’m not sure if the G1 and G2 cameras can use this same modification, but the G3 and G5 have the same DIGIC image processor: the only real difference is the G5 has more pixels and more noise in low light conditions. Oh, and a black case.

The patch given below is to be applied to Dave Coffin’s fixdates.c file. The camera ident string test was taken from his parse.c code – I have tried to keep the strings to check fairly abstracted, so feel free to apply this to any other cameras that are just a model number away from proper compatibility:

--- fixdatesG3.c	Thu Feb 24 21:03:16 2005
+++ fixdates.c	        Thu Feb 24 21:42:42 2005
@@ -17,12 +17,6 @@
 short order;
 int timestamp;

-// make sure we don't make mistakes randomly rewriting data
-// (iws - 24feb05)
-char *MUST_MATCH_MAKE="Canon";
-char *MUST_MATCH_MODEL="Canon PowerShot G3";
-char *NEW_FAKE_MODEL="Canon PowerShot G5";
-
 /*
    Get a 2-byte integer, making no assumptions about CPU byte order.
    Nor should we assume that the compiler evaluates left-to-right.
@@ -62,8 +56,7 @@
  */
 void parse_ciff(int offset, int length)
 {
-  int tboff, nrecs, i, type, len, roff, aoff, save, j;
-  char name[256],make[128],model[128];
+  int tboff, nrecs, i, type, len, roff, aoff, save;

   fseek (ifp, offset+length-4, SEEK_SET);
   tboff = fget4(ifp) + offset;
@@ -75,25 +68,6 @@
     roff = fget4(ifp);
     aoff = offset + roff;
     save = ftell(ifp);
-
-    // confuse iPhoto 5/5.0.1 into working with PowerShot G3 RAW images
-    if (type == 0x080a) {                       /* Model tag */
-      fseek(ifp, aoff, SEEK_SET);
-      fread(name, 256, 1, ifp);
-      strcpy(make, name);
-      strcpy(model, name + strlen(make)+1);
-      // do we have a match ?
-      if (strcmp(make,MUST_MATCH_MAKE) == 0) {
-        if (strcmp(model,MUST_MATCH_MODEL) == 0) {
-          // looks good, so paste our text over the original buffer,
-          // and chuck all of that back out again
-          strcpy(name+strlen(make)+1,NEW_FAKE_MODEL);
-          fseek(ifp, aoff, SEEK_SET);
-          fwrite(name, 256, 1, ifp);
-        }
-      }
-    }
-
     if (type == 0x180e) {		/* Get the timestamp */
       fseek (ifp, aoff, SEEK_SET);
       timestamp = fget4(ifp);
@@ -116,7 +90,7 @@
   }
   for (arg=1; arg < argc; arg++)
   {
-    ifp = fopen(argv[arg],"r+b");
+    ifp = fopen(argv[arg],"r");
     if (!ifp)
     { perror(argv[arg]);
       continue;

So there are two ways to get this working: grab the OS X 10.3.8 binary file, or build it yourself.

To build it, ensure you have the Developer Tools loaded, grab fixdates.c, patch with the .diff, and then build with something like:

gcc -o fixdatesG3 fixdates.c

and you're done. Run the program with the name of a .CRW file, and the file will be changed so that the model reads G5 and the timestamp of the file is set to the time the image was taken.

You can automate this for all the files on a CF card with something like this:

find . -name "*.CRW" -exec fixdatesG3 {} \;

but do make sure you have copied them to a local directory first - don't risk loosing images for the sake of a few seconds wait.

You might also want to run:

find . -name "*.THM" -exec rm {} \;

to clean up the unneeded thumbnail files.

After that, simply fire up iPhoto and import the directory. If you use the find command line above, it's perfectly safe to have .JPG and .MOV files on the card too, and they will not be modified. Also note that the camera make and model have to match 100% before the name will be changed, and that the strings have to be embedded within a Canon format RAW file block before the contents will be modified. There will be no warning in the case of failure, although the timestamp will still be updated if a shooting date is found.

I'm contemplating wrapping this code into an Applescript droplet so it can be called directly from Image Capture, but that's not a priority for me right now.

Share

The Infinite Matrix | Cory Doctorow | I, Robot

The Infinite Matrix | Cory Doctorow | I, Robot: http://www.infinitematrix.net/stories/shorts/i-robot.html

Very well worth the time to read, and not at all offensive if (like me) Asimov was one of your main reads whilst growing up. Sort of Asimov-meets-Matrix, but that’s belittling the story immensely.

Share

Two-Finger-Scrolling with pre-2005 PowerBooks and iBooks

Two-Finger-Scrolling with pre-2005 PowerBooks and iBooks: http://www-users.kawo2.rwth-aachen.de/~razzfazz/

Wow – works a treat on my 12″ PB. No more uctrl so I get my Fn key back, and can exprience the whole new world (?) of one handed scrolling…

(Thanks Ben !)

Share

Apollo 11 – 17 Missions: Fullscreen QTVR photo from panoramas.dk

Apollo 11 – 17 Missions: Fullscreen QTVR photo from panoramas.dk: http://www.panoramas.dk/fullscreen3/f29.html

Now these are stunning – the new scans of the originals are excellent quality, and the scale of things becomes much more apparent (even on a tiny 1024×768 display).

Share

BBC NEWS | Technology | Reboot ordered for EU patent law

BBC NEWS | Technology | Reboot ordered for EU patent law: http://news.bbc.co.uk/1/hi/technology/4232971.stm

Round 1 for common sense, but the battle will drag on as long as there’s money for corporate lawyers. Hopefully, there will be time to gather more opposition now that things have to be restarted: my fear is that this win will relax people and the process will actually be easier to force through the second time around…

Share

Cable Forum: Major ntl budget cutbacks threatens service for customers

Cable Forum: Major ntl budget cutbacks threatens service for customers: http://www.cableforum.co.uk/article/137/major-ntl-budget-cutbacks-threatens-service-for-customers

  • Only Network Masters/Outages affecting more than 30 telco subs are to be attended out of hours.
  • Power Outages will be attended until 11pm, then cab will have to run on batteries until 8am.
  • No CATV/BB Outages to be attended out-of-hours.
  • No Service Refferals to be attended out-of-hours.
  • No Preventative Maintenance, only fire-fighting.
  • No “Network” Upgrades.
  • No Overtime.

Oh dear – I am already in the middle of moving from cable to ADSL (I can’t stand the lack of static IP and the far-too-low-upload speeds), but if I wasn’t I’d be on hold^H^H^H^Hcalling BT this morning.

That’s assuming that it’s all true, of course: it might, however, be the first solid sign of a merger/takeover since the whole ntl:/Telewest rumour mill began. I’m still not convinced that just because they are the two largest Cable companies they should merge, but then I rarely agree with business analysts.

Share

BBC News with all the intelligent discourse of a /. discussion…

BBC NEWS | News Front Page: http://whitelabel.org/wp/wikiproxy.php

Browse the BBC News website, and for each article an extra side box will appear linking to all blogs (from Technorati) that have an item about the story you’re browsing.

So, for all those times you wished that the BBC News had the quality of discussion, argument and general discourse of /. wish no more: it’s here, right now !

Share
Page 1 of 212