It is possible to get the image dimensions especially if the current image is vertical or horizontal. I want to make rollover image navigation like in stopdesign gallery theme.
I'm planning on adding this to the next version -- the ability to get the original dimensions, the resized dimensions, or whether it's landsape or portrait.
Currently it's quite difficult, but you could use PHP image functions to (inefficiently) get the sizes.
It might be in the EXIF data for the image, but we haven't really considered this yet. There are a couple options, including letting you rotate within ZP. We'll see.
You are correct! The theme functions are not documented yet (hopefully will be soon), but look in template-functions.php for a "raw" list.
For quick reference, the functions are: // Returns an array [width, height] of the default-sized image. function getSizeDefaultImage()
// Returns an array [width, height] of the original image. function getSizeFullImage()
// The width of the default-sized image (in printDefaultSizedImage) function getDefaultWidth()
// The height of the default-sized image (in printDefaultSizedImage) function getDefaultHeight()
// The width of the original image function getFullWidth()
// The height of the original image function getFullHeight()
// Returns true if the image is landscape-oriented (width is greater than height) function isLandscape()
// Returns an array [width, height] of the image sized based on the given parameters. function getSizeCustomImage($size, $width=NULL, $height=NULL, $cropw=NULL, $croph=NULL, $cropx=NULL, $cropy=NULL)
I personally like using Picasa2 (google it) to manage all my photos, then select the ones to upload to ZP and export them. They're rotated automatically.
Any good photo editor/viewer will correctly rotate them based on EXIF data, but Zenphoto doesn't have a good EXIF implementation yet, so we've been waiting on that. Hopefully we can get that in the next version.
http://www.re-lee.com/photos. I have rotated my portrait images to be the correct orientation in Nikon's Picture Project software or with Windows Viewer. The images are still in landscape when they should be in portrait. Any other suggestions?
Comments
Currently it's quite difficult, but you could use PHP image functions to (inefficiently) get the sizes.
What I do at the moment is just save the picture to whatever way that I need them to be seen via "Window Picture n Fax Viewer" before upload.
I'm also thinking of writing my own function for it, but not sure where the best place to implement it would be.
FYI for anyone reading this. Getting the dimensions of the original image is now supported as of 1.0.3.
For quick reference, the functions are:
// Returns an array [width, height] of the default-sized image.
function getSizeDefaultImage()
// Returns an array [width, height] of the original image.
function getSizeFullImage()
// The width of the default-sized image (in printDefaultSizedImage)
function getDefaultWidth()
// The height of the default-sized image (in printDefaultSizedImage)
function getDefaultHeight()
// The width of the original image
function getFullWidth()
// The height of the original image
function getFullHeight()
// Returns true if the image is landscape-oriented (width is greater than height)
function isLandscape()
// Returns an array [width, height] of the image sized based on the given parameters.
function getSizeCustomImage($size, $width=NULL, $height=NULL, $cropw=NULL, $croph=NULL, $cropx=NULL, $cropy=NULL)
Thanks
• Photoshop
• Windows Image Viewer
• IrfanView
• etc.