Search

Is it possible to get the original width and height of an image into a utility? I'd like to be able to call the image url/function with 600px width if it's a landscape image, and a 600px height if it's a portrait image.

A little XML:

<entry id="115" comments="0">
  <categories>
    <item handle="" />
  </categories>
  <title handle="photo-3">Photo 3</title>
  <photo size="53 kb">320247216_1bcadef0a2_o.jpg</photo>
  <date time="15:10" weekday="5">2008-02-01</date>
</entry>

Yes, meta information on files are supposed to be in there, we must've overlooked this.

I do not see image meta information in rev5. Am I overlooking something? Or is this not implemented yet?

It seems about 1/2 of the images a client is uploading do not have the height and width attributes in their meta tag. i’m trying to do the same thing as the original poster, allow users to upload images of w/ arbitrary aspect ratios that will not have a dimension exceeding a given number of pixels.

@hoopy, please try and find out what’s so special about these images. Is it maybe uppercase suffixes, or is it the file type? If you know, please post a bug report on GitHub.

I remember coming across a bug like this in rev5 I think—at that time I think it was caused by resaving the field after the upload. The reconstruction of the metadata in field.upload.php was failing.

Could this lack of detail be caused by uploading images with the metadata stripped out of the image file?

I have just been puzzling why images in one section seemed to have the height and width available and the other section, not. I uploaded some new images to the offending section which I did not run through a utility that scrapes out the metadata and the height/width was there.

        <object-image size="0 bytes" path="/design_objects" type="image/png">
        <filename>ACP_09_10_12_p06_07.png</filename>
         <meta creation="2009-11-27T23:17:33-05:00" />
       </object-image>

versus

        <object-image size="364 kb" path="/design_objects" type="image/png">
        <filename>MonetWebsiteList.png</filename>
         <meta creation="2009-12-03T10:44:24-05:00" width="528" height="433" />
        </object-image>

I have edited the design object data, changing the image, then just changing other information and resaving but the width and height info continue to be served up in the XML for the unstripped images.

Err… No its not that. I just uploaded the same image with the metadata stripped and the height and width values are there.

      <object-image size="356 kb" path="/design_objects" type="image/png">
       <filename>MonetWebsiteList_PONGED.png</filename>
        <meta creation="2009-12-03T11:04:26-05:00" width="528" height="433" />
       </object-image>

Odd… Not working, now working.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details