I have situations where both dimensions will be useful. The first being the actual image dimensions after being pumped through connector.php & the actual dimensions of the image that resides in /assets/components/gallery/files/_galleryid_/_image_name_
I was working on a snippet to get the org image sizes...
[[!getImageSize? &src=`[[!+gallery.id]]/[[!+galitem.filename]]` ]]
# getImageSize snippet
$imgsrc = MODX_BASE_PATH . 'assets/components/gallery/files/' . $src;
//echo $imgsrc;
$imginfo = getimagesize(&imgsrc);
return $imginfo[3];
#the image tag
<img
class="[[+galitem.imgCls]]"
src="/assets/components/gallery/files/[[!+gallery.id]]/[[!+galitem.filename]]"
alt="[[+galitem.name]]"
[[!getImageSize? &src=`[[!+gallery.id]]/[[!+galitem.filename]]` ]]
/>
but seem to be having issues with that too... It was working and returning the height & width, but now it seems broken again.....
UPDATE:
hmmm, it seems fine with this:
[[!getImageSize? &gallery=`2` &image=`25.jpg` ]]
but not this:
[[!getImageSize? &gallery=`[[+gallery.id]]` &image=`[[+galitem.filename]]` ]]
(I split the $src up into $gallery & $image)
I get a modx error warning:
[2012-02-12 15:53:56] (ERROR @ /var/www/vhosts/gaycompanylimited.com/httpdocs/core/cache/includes/elements/modsnippet/24.include.cache.php : 18) PHP warning: getimagesize(/var/www/vhosts/gaycompanylimited.com/httpdocs/assets/components/gallery/files/[[+gallery.id]]/[[+galitem.filename]]) [<a href='function.getimagesize'>function.getimagesize</a>]: failed to open stream: No such file or directory
but the file is clearly there ,,,?!?!
[ed. note: sean69 last edited this post 14 years, 8 months ago.]