TextObject's width and height properties

Hello ZenPhoto team!

I am being more and more impressed by ZP!
The TextObject class is just what I need to display YouTube and Vimeo hosted video's. Great stuff.
Now I have a small issue with the video's height property.

I see ZP is not able to pick up the height (and width) from the iFrame's properties and get's them from the image size option, printDefaultSizedImage() in my case 900 x 600 px or 900px on the longest side
Since text files have no natural height and width, we set them based on the image size option. This happens after the call PersistentObject(). The rest of the code there sets up the default title.
I actually thought that the plugin would (or could?) use the my_video.jpg I have next to my my_video.txt file in the albums folder. I understand ZP generates the thumbnail from the sibling but why not get the width and height parameters and use that to style the span.textobject?
The code of the object instantiation function is mostly required. Plugin "images" follow the lead of videos in that if there is a real image file with the same name save the suffix, it will be considered the thumb image of the object. This image is fetched by the call on checkObjectsThumb(). There is also code in the getThumb() method to deal with this property.
Any tips on modding that or is it maybe already implemented? Or maybe is it already implemented and do I miss something?
Another option would be to get the properties from the iFrame's width/height?

Cheers

Comments

  • acrylian Administrator, Developer
    No need to post the same topic twice...
    I actually thought that the plugin would (or could?) use the my_video.jpg I have next to my my_video.txt file in the albums folder.
    Yes, it does that but only for the thumbs so the real size of that image is not needed or used anywhere anyway because text objects are displayed directly on the image page anyway (like videos).

    As you said a text object which can be any type of text has no dimension. Using it with Youtube & Co videos is a trick/workaround. The span is of course set via CSS and naturally not all theme may have something for text objects.

    Youtube & Co provide an embed code with predefined sizes you manually should adjust to fit your theme layout.
Sign In or Register to comment.