Member
Member
Jole   2011-11-30, 20:26
#1

How to get image source path (

Member
Member
Jole   2011-11-30, 20:28
#2

Sorry, web link mistake. An example html source code is from this page:
http://www.zenphoto.org/demo/album2/Cosmos06.jpg.php

Administrator
Administrator
acrylian   2011-11-30, 20:34
#3

You should escape code correctly.

You probably are looking for getFullImageURL. However "/demo/cache/album2/Cosmos06_595.jpg" is the cached sized image, not the full one.

I suggest to review:
http://www.zenphoto.org/news/theming-tutorial
http://www.zenphoto.org/news/functions-documentation

Most every "print" function has also a "get" variant.

Member
Member
Jole   2011-11-30, 20:59
#4

Yes, I know it is cached sized image, and I need image source path for that image not for full one.

I tried with getFullImageURL but I do not get "pretty" path even if page is cached before. Page html source shows:

Member
Member
sbillard   2011-11-30, 22:47
#5

getDefaultSizedImage() will give you a link that will display the normal sized image. This is what is used in the printDefaultSizedImage() function typically used in themes. However, this link may be directly to the cache or may be to the image processor depending if a cached version of the image exists.

There is not a means of "forcing" the image to be cached so that you can guarentee a link that is not the image processor.

Member
Member
Jole   2011-12-01, 08:50
#6

I tried that, but even image is cached I do not get image source path of image displayed because I am not using default image size.

In "printCustomSizedImageMaxSpace" I used custom values, example:

printCustomSizedImageMaxSpace(getBareImageTitle(),725,725); to best fit page design, so my images are 725 x 408 pixels.

With getDefaultSizedImage() I get path to image which height is 595, default size I guess (of course if I use printDefaultSizedImage() to make that image first).

So I tried with printCustomSizedImage() I hooped I will get right image path but I get error.

If you have any suggestions please let me know.

Administrator
Administrator
acrylian   2011-12-01, 11:59
#7

If you use "customimage" functions you need to pass parameters to them. Again, "print" functions print html or even html constructs for theming convenience. If you want just the pure date (a path in this case) you have to use the "get" ones.

Member
Member
Jole   2011-12-01, 12:25
#8

I am not quite sure now, what parameters and where to pass them. Can you give me an example for my case?

Administrator
Administrator
acrylian   2011-12-01, 12:55
#9

Above you say you don'T use the default size image, so that means your theme uses custom sizes. Then you know what values to pass to the parameters.

All parameters are documentated on the functions documentation. On the user guide there is also a tutorial how to read that functions guide.

Also again:

Quote:` cached sized image

Quote:but for getFullImageURL I always get:

' /zp-core/full-image.php?a=folder&i=image.jpg&q=75'

=> yes, as even full images are processed for watermarks (since we are file based it is easier to always do than to check if we need to or not - less overhead). To by pass that you need to use the getUnprotectedFullImageURL. Please see the functions documentation for the correct spelling, I don't have it in my head right now.

Quote:`

Member
Member
Jole   2011-12-01, 14:19
#10

I tried this:

getProtectedImageURL() and getFullImageURL(); and I get the same, this:

/zp-core/full-image.php?a=folder&i=image.jpg&q=75

Also I tried this:
getDefaultSizedImage() and I get this:
/zp-core/i.php?a=folder&i=image.jpg&s=595&cw=&ch=&q=85

and this:

getUnprotectedImageURL() and I get this:
/albums/folder/image.jpg

and this what you told me getDefaultSizedImageURL and I get this:
Fatal error: Call to undefined function getUnprotectedFullImageURL() in ......image.php on line....

So, whatever I try I can not get this /cache/folder/image_w725_h408.jpg

Administrator
Administrator
acrylian   2011-12-01, 14:55
#11

Quote:getProtectedImageURL() and getFullImageURL(); and I get the same, this:

/zp-core/full-image.php?a=folder&i=image.jpg&q=75
Yes, as said this is the protected full image url.

Quote:Also I tried this:
getDefaultSizedImage() and I get this:
/zp-core/i.php?a=folder&i=image.jpg&s=595&cw=&ch=&q=85
Yes, that is the url to the yet uncached default sized image.

Quote:getUnprotectedImageURL() and I get this:
/albums/folder/image.jpg
I meant getUnprotectedFullImageURL()instead I meant getUnprotectedImageURL(). Sorry, I don'T have all correct function names present thus I referred to the functions documentation. So that is the direct url to the full image which I thought you want to get.

What you actuallywant to get is the cached (sized) image url. As said several times you get that by using the "get" custom sized get functions (be it default, custom or custom maxspace). Since that cached image is not cached automatically but on request it always goes first through i.php to create that cached file. Please read
http://www.zenphoto.org/news/how-does-zenphoto-cache-
http://www.zenphoto.org/news/is-it-really-necessary-to-pre-cache-my-images-at-all-

So /zp-core/i.php?a=folder&i=image.jpg&s=595&cw=&ch=&q=85 is actually the url to an uncached /cache/folder/image_s595.jpg

Member
Member
Jole   2011-12-01, 17:11
#12

Thanks for note. I tried with this:

getCustomSizedImageMaxSpace(725,725)

And it works fine, of course I needed to pass parameters (725,725) in my case I use that size of image. Now I get right image path.

Thank you again.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.