[dev] Ansel / copy image functionality

Michael Rubinsky mike at theupstairsroom.com
Sat May 12 15:37:50 UTC 2007


Quoting Chuck Hagenbuch <chuck at horde.org>:

> Quoting Michael Rubinsky <mike at theupstairsroom.com>:
>
>> I was going to re-implement the 'image copy' functionality that was
>> removed when the image data was removed from datatree.  I remember
>> at  that time, we had a discussion as to why it was removed and
>> Chuck, you  had said that it was currently broken since, for one, it
>> didn't copy  attributes. (See
>> http://marc.info/?l=horde-dev&m=116550803912849&w=2)   My question
>> is, I don't see any reason why something simple like the  following
>> wouldn't work it seems to duplicate the image correctly,  along with
>> the EXIF data (which is taken from the raw image data).
>>
>> <code>
>> $oldImg = $GLOBALS['ansel_shares']->getImage($id);
>> $newGal = $GLOBALS['ansel_shares']->getGallery($gal_id);
>> $result = $newGal->addImage(array('image_caption' => $oldImg->caption,
>>                                'data' => $oldImg->raw(),
>>                                'image_filename' => $oldImg->filename,
>>                                'image_type' => $oldImg->type));
>>
>> </code>
>
> As you said this would miss the tags (probably want them on a copy).

OK. Will add that to the copy.

> The other thing is that if the image has been manipulated at all, the
> raw data won't have the exif tags in it anymore.

Ah. I knew I was missing something.  Just copy the exif tags from the  
attributes table, right?


Thanks,
mike

--
The Horde Project (www.horde.org)
mrubinsk at horde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-keys
Size: 2013 bytes
Desc: PGP Public Key
Url : http://lists.horde.org/archives/dev/attachments/20070512/5e60cdda/attachment.bin 


More information about the dev mailing list