Post a Reply to:

Pictures

Well of course nothing goes perfectly. I finally did my picture-gallery-creation software. What had hung me up was figuring out a way to get a frame from an AVI -- the movies my camera can take -- into a JPG, automatically. I was trying at first to use a program called ImageMagick -- an Open Source image manipulation backend which runs from the UNIX command line -- to convert them, but it turns out that my type of AVI was not yet supported. I figured it would be better to use ImageMagick to do the jpeg conversion, rather than Photoshop as I had done before, since it's easier to control from the command line. So, to get that magical frame from the AVI, I delved into AppleScript.

In case you don't know, AppleScript is a GUI scripting language for MacOS which is used to manipulate the user interface in ways that you could normally only do with the mouse.

So, my gallery-creation script (which runs in perl) generates an AppleScript, which it then runs. This script opens the AVI in question in QuickTime, and then asks me to pause the movie on the frame I'd like to use and click OK. It then proceeds to use QuickTime's Export option to create a JPEG.

Ok, to create a psuedo-JPEG. Apparently it adds some stuff on that doesn't sit quite right with ImageMagick. So, if you're looking at a page of thumbnails, any of the pictures where the top and left sides are a white bar, those are movies.

It's good enough for now. I'll either figure out a better way to export, or else crop the area that's correct, and discard the rest. Next time I import a bunch of pictures, I'll work on it.


6546784