Implementing a Mamiya.pm library

Started by gugus101, December 20, 2010, 07:05:27 PM

Previous topic - Next topic

gugus101

Hi Phil,

even though I am not a perl newbie I struggle a bit to implement a pm file for my Mamiya ZD back used with a 645 AFD.

It seems as if the native exif tag table for TIFF does already a pretty good job - but the devil is in the detail :-)

For example the "standard" ImageWidth and ImageHeigth is exchanged, and the value reported seem to belong to a thumbnail - not the full image. Using "exiftool -v" I can see the correct values in the first subdir level:

ExifTool$ /opt/ActivePerl-5.12/site/bin/exiftool -v /tmp/MMFC0007.MEF

  ExifToolVersion = 8.40
  FileName = MMFC0007.MEF
  Directory = /tmp
  FileSize = 36576652
  FileModifyDate = 1270579102
  FilePermissions = 33261
  FileType = MEF
  MIMEType = image/x-mamiya-mef
  ExifByteOrder = MM
  + [IFD0 directory with 24 entries]
  | 0)  SubfileType = 0
  | 1)  ImageWidth = 144
  | 2)  ImageHeight = 192
  | 3)  BitsPerSample = 8 8 8
....
  | 20) SubIFD (SubDirectory) -->
  | + [SubIFD directory with 18 entries]
  | | 0)  SubfileType = 0
  | | 1)  ImageWidth = 4016
  | | 2)  ImageHeight = 5344
  | | 3)  BitsPerSample = 12 12 12

These values are very similar to what PS CS5 / LightRoom 3.3 reports: 5336 x 4008. Comparing to my Olympus raw file reports it seems as if there is  always a discrepancy between the EXIF data and at least the Adobe raw report.

But for implementing the a Mamiya.pm I am more then happy to share a MEF file with the community or very open for some advice how to create a basic Mamiya.pm library. So please let me know if - where - how I can deposit a file (I own several sites).

Nothing urgent but the garbled values are popping up for MEF in any public domain solution - like ufraw, Photo Organizer, irfanview (on Windows) - or even Jeffrey Friedl's Plugin for LightRoom.

Gruss

- Uli

Phil Harvey

Hi Uli,

Thanks for the offer, but I may have some bad news for you...

The way ExifTool is structured, Mamiya.pm would be used to decode the Mamiya maker notes, which isn't what you want to do.  (I have one sample and there isn't much information stored in the maker notes anyway.)

The place to do this is in Exif.pm (the module where all the standard Exif and TIFF tags are decoded), but I always resist adding vendor-specific patches to this code, especially in cases where the file is indistinguishable from a standard TIFF file, which seems to be the case here.  (Note that ExifTool doesn't use the file extension to recognize the file type.)

The bottom line is that you will need a strong argument to convince me to patch Exif.pm for a Mamiya-specific quirk.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gugus101

Hi Phil,

so if I get right the Vendor.pm just adds EXIF tags, but does not replace "standard" tags like ImageWidth. In case of the MEF format it sounds as if Mamiya does not adhere to the "standard" EXIF position of values - or lets say at least the orientation is special.

The second problem seems to be that the MEF file contains at least four images, where the first is a low res thumbnail, probably for the build-in LCD (144x192 px). Only the second contains the full resolution image (4016x5344 px 12 Bit RGB - Adobe Camera Raw 6.3 reports 5366x4008 not sure from where they get their information).

So the only option to handle these files would be the use of a "custom" Exif.pm file - and I agree, this Camera model / digital back is probably not the most popular :-)

But thanks a lot for your quick responds! I now have an idea how to start customization - even though I will never be able to share it with the rest of the community...

Uli

Phil Harvey

Quote from: gugus101 on December 21, 2010, 01:40:47 PM
so if I get right the Vendor.pm just adds EXIF tags, but does not replace "standard" tags like ImageWidth.

Close.  The Vendor.pm just defines tags in any vendor-specific IFD (ie. the EXIF maker notes).  Any tags written to a standard EXIF/TIFF IFD are defined in Exif.pm, whether or not they are proprietary.

QuoteThe second problem seems to be that the MEF file contains at least four images, where the first is a low res thumbnail, probably for the build-in LCD (144x192 px). Only the second contains the full resolution image (4016x5344 px 12 Bit RGB - Adobe Camera Raw 6.3 reports 5366x4008 not sure from where they get their information).

ExifTool does not extract these images because they are not self-contained.  Basically, only JPEG-format embedded images are extracted because uncompressed embedded images (such as these) would require a supporting file structure to be added before they could be used as a stand-alone image file.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).