We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40452
    • 10 Posts
    Hi guys I've searched the forum and closest I came to, was somebody mentioning a getImageSize snippet, yet I couldn't find it in the revo addon dir.

    I have my custom chunks and am using the Gallery plugin, what is your recommendation in me being able to pick up the actual image size, all I get is the default 500px.

    Is there a method within the Gallery plugin AP!?

    Thanks guys.... MODx ROCKx!! [ed. note: rohan.r last edited this post 14 years, 2 months ago.]
      • 40452
      • 10 Posts
      Snippet getImageSize

      $imagesize = getimagesize("../" . $src);
      $dimensions_obj = (object) array('width' => $imagesize[0], 'height' => $imagesize[1]);
      return $dimensions_obj->$dimension;


      call
      for width
      [[getImageSize? &dimension=`width` &src=`path of image`]]


      for height
      [[getImageSize? &dimension=`width` &src=`path of image`]]