Mail Index


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ApacheGallery] representation of Aperture



On Fri, Aug 01, 2003 at 08:34:25AM +0200, Thomas Corell wrote:
>
> I noticed, that representation of Aperture wasn't "nice" when pictures
> came from a Olympus camera.
> 
> It seems that some Camera's have both a 'AperturValue' and 'FNumber'
> EXIF tag. But Olympus camera's only have a 'FNumber' tag.
>
> The following will correct that.

I wasn't aware that ApertureValue needed a conversion to get the
aperture-value, and FNumber doesn't. For big apertures (smalle values),
it was roughly correct; thats why I didn't notice it until I was looking
at one of my f/11-exposed pictures.

This time I have confirmed my findings at:

 http://www.ba.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html

Sorry for the noise.

So yet another special-case is need'ed to get the aperture-value (in
nice format) from the FNumber EXIF-tag :(

--- lib/Apache/Gallery.pm       Mon Apr 21 13:26:51 2003
+++ /usr/local/lib/perl5/site_perl/5.6.1/Apache/Gallery.pm      Sat Aug 2 19:56:26 2003
@@ -818,6 +818,18 @@
                                        }
                                }
                        }
+                       if ($exif_key eq 'FNumber') {
+                               if ($value =~ /^(\d+)\/(\d+)$/) {
+                                       $value = eval { $1 / $2 };
+                                       if ([email protected]) {
+                                               $value = [email protected];
+                                       } else {
+                                               # round to one decimal
+                                               $value = int($value*10+0.5)/10;
+                                       $value = "f" . $value;
+                                       }
+                               }
+                       }
                        $imageinfo->{$human_key} = $value;
                }
        }

-- 
Don't waste space