under construction, as ever :)

Habbie’s present & converting .pictClipping files

February 5th, 2007 Posted in code

Last thursday, Habbie’s birthdaypresent, a new Benq 20″ widescreen LCD monitor arrived. To make sure that it survived the trip trough the postal system, i connected it to my macbook. It worked just fine and to show this to Habbie, who was at work, i thought i’d capture an image of the display-in-action with the iSight in my laptop.

First i thought i’d use Photo Booth, but this app makes the screen all-white while capturing to simulate flash-lighting, spoiling the always-fun Droste effect. Thus i resorted to Comic Life, but this application doesn’t let you save your captured images, they are only for in-comic use. Obviously i could have made a one-panel comic out of the image but this would add a lot of blank space to the image, thus not a good option. I then found that the dragging of the still also worked to the Desktop, but this generated a file with .pictClipping extention that would only open in Finder as a ‘picture clipping’. Oddly this file had a size of 0 bytes, but the image would still show so the data had to be stored _somewhere_ :o
Searching a conversion method using Google only resulted in a tip to use Preview and export which didn’t work for me - my Preview couldn’t open the file - and some forum postings suggesting that this 25-euro program could convert my .pictClipping. Meh!

When i explained this issue to Habbie on saturday, he used some ktrace-magic on the .pictClipping-open-action performed by Finder. This led us to “filename.pictClipping/..namedfork/rsrc” which apparently contained the actual image data. The size of this rsrc was quite large, suggesting that it was in some bitmap-like format. Our idea was to extract this data. Using hexdump and strings Habbie found that the format was probably TIFF.

Habbie's new monitor

From the TIFF specification we learned that tiff headers begin with either II or MM, depending on the endianness used, and indeed stripping the first bit up to the first occurance of II or MM gave us a file that the ‘file’ command recognised as TIFF. Obviously this image is easily convertable, resulting in the web-usable image displayed on the right-side of this paragraph :D

Since i had had so much trouble with this conversion i thought it’d be nice to make a script that does the trick, which is available from the link below.

download Download pc2tiff here!

USAGE: Simply put the script in your homedir, open a terminal, make the file executable with “chmod +x” if it isn’t already, and run with “./pc2tiff filename.pictClipping”.

NB: only tested on my macbook running Mac OS X 10.4.8. I don’t think this will work on non-Os X systems; but my understanding of Resource forks etc is rather limited so correct me if i’m wrong :)

  1. 3 Responses to “Habbie’s present & converting .pictClipping files”

  2. By BugBlue on Feb 8, 2007

    You could try to email it with mail (obviously the other side should have mail too). Secondly you could use preview. Open it in preview and say ’save as…’. If the Save as is disabled, just copy, press Command+N and use the enabled “Save As…”. Saves a lot of trouble.

    And of course there are always the tool from /Developer who could help you out in case of problems with resourceforks.

    Nice, but ugly hack IHMO.

  3. By Liessa on Feb 9, 2007

    As stated in the post i tried the Preview suggestion but it wouldn’t open the image. I did use it for converting the .tiff to .jpg though ;)

    As for the uglyness, i wouldn’t be surprised if there is a more ‘official’ way to do this, but it works :)

  4. By Andrew on Mar 26, 2007

    I just encountered this same problem (which, after a Google search, led me here). I could not open the .pictClipping file with Preview so I opened it with the Finder and discovered that the picture was actually in the Clipboard. So I just selected all and copied - I could then create a new document in Photoshop and just paste in the picture! Sweet!

Post a Comment