These forums are provided for community interactions only. For official support please submit a support ticket.
You are not logged in.
I have a variety of shaped images - portrait, landscape, square. When I call director I set up a custom format that has a width of 950 and a height of 550 but no cropping.
So if a landscape image is returned it will only have a width of 950 if this also means the height is 550 or below. For everything else, landscape, portrait or square it will show an image of height 550 and an unknown width.
Is there an easy way to find out the width of the content item returned?
I know I can use content->original->width/height and there's probably some messy maths I can use to work out what the returned images dimensions will be but is there a simpler way?
Thanks
Offline
+1 on this. Are the titles and image dimensions available in the array?
Offline
in your loop:
$data_array['video'][$count]['preview']=str_replace('\\','/',$image->original->url);
$data_array['video'][$count]['height']=$image->original->height;
$data_array['video'][$count]['width']=$image->original->width;
$data_array['video'][$count]['ratio']=( $data_array['video'][$count]['width']/ $data_array['video'][$count]['height'])then you can use the "ratio" key to mess with your other formats (since you know the ratio of the original before it was shrunk with the formats)
Offline