thanks Leo and Rob; right now this sounds like rocket science for me... I will have to take a look at optilude's b-org tutorial but I really have no brain for this now. what about using Sidnei's Marshall product?

at the end of the day what I want is a mechanism to import not only images but also NITF files (XML dialect used to define the content and structure of news articles also developed by the IPTC, http://www.nitf.org/).

I don't want to create additional content types, I prefer to use Image and News Item and decorate them with metadata.

best regards

Héctor Velarde
Desarrollo e Internet
La Jornada
+52 (55) 9183 0300 x4160

Rob Miller wrote:
Leonardo Rochael wrote:
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.

the third of these choices seems preferable, IMO. it would also be possible to define a new marker interface (IIPTCImage, possibly) and declare this to be implemented by the ATImage class via ZCML. you could define adapters, listen to events, and declare new views based on the marker interfaces. and you could re-use the same marker interface for news items, or anything else that may have an ImageField, w/o needing to subclass from ATImage.

-r



_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to