[ansel] Patch for loading EXIF data on image upload

Heath S. Hendrickson heath at outerspaceconsultants.com
Mon Mar 22 19:42:11 PST 2004


Heath S. Hendrickson wrote:

> What may be more important is to have it write the data (if not 
> already there) before committing any edits to the image file.  That 
> would keep from losing the data before it's too late.
>

Answering myself, attached is a simple patch that modifies image.php to 
do just that... this should be done in addition to the previous 
super-patch (I removed all the stuff that was included in that patch 
from here).

h


-------------- next part --------------
Index: image.php
===================================================================
RCS file: /usr/local/horde/cvs/ansel/image.php,v
retrieving revision 1.68
diff -u -r1.68 image.php
--- image.php	16 Mar 2004 02:51:17 -0000	1.68
+++ image.php	23 Mar 2004 03:37:05 -0000
@@ -348,6 +387,12 @@
     } else {
         $image = &$ansel_shares->getImageById($image_id);
 
+        // check to see if we have the Exif data preserved in the datatree
+        if (!$image->get('Exif')) {
+            // no, so let's do that now.
+            @Ansel_ImageData::setExifData($image);
+        }
+
         switch ($actionID) {
         case 'rotate90':
         case 'rotate180':


More information about the ansel mailing list