Thursday 19 March 2009 3:04:01 am
I created a extension for eZPublish for publishing content from another system. For images I was using the eZImage class (didn't notice it was depracated...), but since the 4.1 update, it is not working anymore. A little investigation showed the eZImage class is removed (this was when I noted it was deprecated, stupid me), so I have to rebuild some stuff. The nice thing about the eZImage class was that it handled a lot of stuff for me, like making reference versions of the image for rss, thumbs, etc and I can't find out how to that with eZImageFile. This way, it looks like eZImageFile is a step backward for me... The code I was using was the following:
$image =& eZImage::create( $attribute->attribute( 'id' ), $attribute->attribute( 'version' ) );
$image->setAttribute( 'contentobject_attribute_id', $attribute->attribute( 'id' ) );
$image->setAttribute( 'filename', $targetname );
$image->setAttribute( 'original_filename', $filename );
$image->setAttribute( 'mime_type', $mime );
$image->store( );
By using this code, the image was automatically copied from the temporary location ($targetname) to the node of the contentObject. Also, references like thumbs were automatically created. Is there a way to do this with eZImageFile? And where is documentation about this stuff, all I can find is the API documentation, but sometimes it is not to clear...
|