[Product Developers] marshaling images in a better way

Leonardo Rochael leo at enfoldsystems.com
Fri Mar 23 22:19:19 UTC 2007


Hi Héctor


Héctor Velarde wrote:
> 
> ...
> 
> I was wondering if there is a way to modify the marshaling of ATImage 
> content type in order to allow it to read the IPTC record embedded in 
> the image to create automatically the image with title and description 
> mapping the headline and caption fields.
> 
> we have been using a Python library called IPTCInfo to read and write 
> information inside JPG images successfully.
> 

I would suggest you create a new product with a new ATImage subclass,
wherein you override the setImage() mutator to call the original one and
then use IPTCInfo to also set the other attributes. Then you need to change
the mimetypes registry to point to your type instead of ATImage.

Alternatively, you could either monkeypatch the ATImage .setImage() (which
is ugly but works when in a hurry) or listen to ObjectModifiedEvents for
ATImages and set the other attributes with the IPTC information.

Cheers, Leo
-- 
View this message in context: http://www.nabble.com/marshaling-images-in-a-better-way-tf3455841.html#a9644213
Sent from the Plone Product Developers mailing list archive at Nabble.com.





More information about the Product-Developers mailing list