[dev] Ansel / copy image functionality

Michael Rubinsky mike at theupstairsroom.com
Fri May 11 15:54:17 UTC 2007


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>

Am I missing something else?  I guess the only other thing would be  
whether or not to also copy the tags to the new image or not...



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/20070511/bff3b6ef/attachment.bin 


More information about the dev mailing list