The Serendipity Handbook

You can now read the (german) handbook here: PDF - https://github.com/s9y/Book (LaTeX source).

Forum-Information

Before posting about errors, make sure that the answer cannot already be found in our FAQ or by searching this forum!
Posting is restricted to registered users (registering is free and simple!) due to recent spam attacks. When having trouble with this board, contact garvin(-at)s9y(-dot)org.

Board index Development Get image dimensions

Discussion corner for Developers of Serendipity.
User avatar
judebert
Regular
 
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL

Postby judebert » Wed Mar 19, 2008 10:44 pm

So... very... busy...

Yes, I recently committed a change to functions_smarty.inc.php which exposed serendipity_getimagesize() as {serendipity_getImageSize file="file" assign="name"}.

It accepts an absolute filesystem path, an HTTP path, or the name of a template file.

The return value is the same as serendipity_getimagesize(), to wit, an array where $name[0] is the width, $name[1] is the height, and $name.mime is set to the mimetype. If the image is found and understood, it may also have a $name[2] as the mime type and $name[3] as the dimension string for an <img> tag.

I do intend to work on exposing the media database as well, but a XSS problem was just identified in the karma plugin. I'll be making sure it's not a problem as my first priority. Then, constraining thumbnails. Then, on to more Smarty media access.
Judebert
---
Website | Wishlist | PayPal

Previous


Return to Development

Who is online

Users browsing this forum: Exabot [Bot] and 1 guest