Digital Media Photography Blogs > Photography

Note to self: always use extension on Macs now


Macs are now as inconvenient as PCs are. I've just been going through a tedious multimedia job. My Dear Old Dad makes image collection CD as his hobby: his first one, Aircraft Spotter, is of scans of WWII vintage aircraft schematics (you can get it on E-Bay, I believe). The new one is a complete catalog of the flowers at the Botanical Gardens in here in Coffs Harbour (Australia). He is using Macs for the task (I got my my first Mac Plus in about 1984 was it, and loved it) but this time around we are using OS X not OS 7. And it is much more difficult.

The problem is that we have hundreds of scans in files with no extension, based on the way Macs used to work. Some are JPEG, some are TIFF. In the old Macs, the type information was stored in a resource fork, and you didn't need to worry about extensions. On OS X, you need the extensions. Without the extension, you cannot double click on a file, because the Mac doesn't have enough information to know which application to launch. This is the same as PCs.

Actually, I am finding it much worse than Windows. At least in Windows applications you can usually open a file up in an application regardless of the extension. But none of the Mac applications I've tried (with the exception of iPhoto) let you open a file that does not have an extension. So we are going through the tedious process of adding the TIFF extension, seeing whether they open, and then adding a JPEG extension otherwise.

Actually, I am guilty here too. My company, Topologi, has a tool for validating whether images are JPEG or TIFF. (Because on Windows the graphics handlers are common, so it is possible to mislabel images with no immediate disaster.) But it too relies on extensions.

So I have two notes-to-self, I guess. First, always use extensions when saving files on the Mac. Second, always write software that allows opening of files with no extension, if that is what the user selects.

Categories





AddThis Social Bookmark Button
Comments (10)
Read More Entries by Rick Jelliffe.

10 Comments

You can find file extension details here including easy-to-understand descriptions and associated applications.
Search by extension, view common and most visited extensions, and click to extension categories
including audio and music files, game files, system files and text files.

You can also add file extension search addon to search directly from your browser (Firefox or IE7)

There's a Jon Udell/Jim Hugunin screencast that demo's the IronPython/Powershell combo (near the end of the screencast) @ http://weblog.infoworld.com/udell/screenroom/ironpython_flv.html

Piping with "Intellisense'd dot notation" is a pretty amazing combination.

>> Yes, it is great that Macs have a decent shell (unlike Windows!)

That *used* to be a true statement. Monad, now Windows Powershell(admittedly (by the folks that built it) heavily influenced by the UNIX commandline) has now changed all of that. And with IronPython now added to the scripting mix you'd probably be amazed at just how much power you have at your commandline finger tips on a Windows box.

Rick Jelliffe said:

Thanks for the tips from everyone! We cannot really use a shell script or automator, because the files are mixed up: so we need to try out each one individually to find the JPEGs. Doing a script mightn't save much effort, because we don't know what mix of JPEG and TIFF there is.

Setting the application to use for opening is an interesting option, but doesn't save many clicks if done by hand for each file; furthermore, we need to find an application that will open the file and then force it to write the type out when it saves the file: assuming we can find an application that will accept the file, we need (in most applications) to actually alter the file before a save is allowed, or do a Save As and then find a new name: in effect this is just as many keystrokes as we are currently using.

The old UNIX way of using a script with the "file" command has been the best option so far. But, like I said, it would have been better to have used extensions from the beginning.

Anonymous said:

What about something like this? This will not work if you put spaces in your file names and remove the echo when the command looks like it works. Just make sure to backup the image folder before trying this kind of thing.


#!/bin/bash
mkdir images_with_ext
for file in images/*; do
ext=`file $file |awk '{print $2}'`
echo cp "$file" "images_with_ext/$file.$ext"
done


Ben said:

You can always use automator to add the tiff and then jpeg extensions. Might speed things up.

Flip said:

Is this post a joke?

Mac OS X still save's data about a file and what to do with it.

Your issue is that the data just didn't cross over.

Simply select all the files. Pull down the FILE menu and select GET INFO. In the info window, toggle the OPEN WITH section and select the app you want the files to be associated with.

No file extensions needed.

Rick Jelliffe said:

Yes, thanks for the hints!

Yes, it is great that Macs have a decent shell (unlike Windows!) and I may have to resort to magic numbers using the file utility, but I had been hoping that my Dear Old Dad would be able to do the work: he is fine with menus but has no experience with shell programming and we chose the Mac because we want that mouse-based interaction.

About 2 years after my parents first got their Macs they looked at me sadly and told me how all their friends had PCs and could do all sorts of things that were unavailable on their Macs. They were happy with what they could do, but felt left out. A year later they informed me that almost all their friend's PCs had choked or died or been infected or had some problem; my parents Macs chugged on, and my Mother was recently still using a decade old finance program, written for different OS (OS 6 probably) and different hardware (Motorola, probably) with no problems. Macs really are good for retirees, I think.

Cheers
Rick

William said:

The inconvenience of this must be dreadful - I'm sorry. I use Linux, and so I only vaguely recall problems like this. Generally, Linux programs use inspection of a file to determine its type. OS X does have a UNIX pedigree, so you should have a utility called "file" which will provide you with a filetype. With a simple script you should be able to rename all of your photos based on their file types in a single step. Just a thought.

William Doane said:

But Macs are as full of tricks as ever!

You may be able to determine the file type from the terminal (located in /Applications/Utilities/) by CDing to the directory with your images (cd /path/to/files/), then typing "file *" (without the quotes). I did this for a couple of files that I had intentionally put the wrong extensions on to see how accurate the file command is:

actualyaJPG.gif: JPEG image data, JFIF standard 1.01, comment: "AppleMark"
actuallyaTIFF.jpg: TIFF image data, big-endian

Also, you can drag & drop any filetype/extension document on any application by holding down the apple-option keys while dragging. The receiving application will TRY to process the dropped file, even though it doesn't recognize the type/extension. So, you could (potentially) drag & drop untyped files onto the Preview application, which opens images in OS X, and use the GET INFO command in Preview to see what file type the images are.

Leave a comment


Type the characters you see in the picture above.

Recommended for You

Topics of Interest

Archives


 
 


Or, visit our complete archive.