I've seen a few posts on this, but no resolution. I would like to use printCustomSizedImageMaxSpace for thumbs, which is fine for pix, but seems to break for videos. It uses the actual video file instead of the same-name thumb, which totally makes sense because the function has no way of knowing whether you're trying to print a custom size of the actual image for display or for thumb purposes.
So what we REALLY need is a separate function:
printCustomSizedImageTHUMBMaxSpace
Am I missing something? Is there a way to print custom sized thumbs that work correctly for video?
Thanks in advance!
bump... help!
ok, but can you give me a bigger hint?
i checked out the function descriptions for the nightly. unless i'm missing something, the CustomSizedImageMaxSpace functions do not have a parameter that determines whether the image to be printed is the actual image or the thumb. is there some way to tell the function this? class? id?
i.e., i'm afraid i need a little more guidance in calling the custom sized thumb functionality - thanks in advance!
The last parameter $thumbstanding has set to "true" if you want a thumb. The id is for a css id only.
printCustomSizedImageMaxSpace(,,,"","", true) should at least work for the thumbnails (for the album thumbs, the album preview one, there is a separate function.
Actually we are still not finished since new issues just occured but those only affect usage on image.php currently. This little function do somehow cause more overhead than expected...
okay - perfect! i misunderstood this because it only talks about watermarking. thanks very much! and yes, i've seen that this function is causing problems. but it is such a useful function and can used for so much, i think it's worth it. thanks very much for developing it!
Hmm... I seem to be having some trouble with this. I've tried to use printCustomSizedImageMaxSpace, but the sizing parameters don't seem to work correctly. AND it seems like it's cropping the images. Are these known issues?
And the printCustomSizedImageThumbMaxSpace isn't working at all for me, but I think it might be something with my mbstring changing when I upgraded to the nightly build. Can't figure out how to change it back to UTF-8 since my config and ini files both already say UTF-8. Not sure that's the problem anyway. Any thoughts?
Yea, I posted this find elsewhere, but I'll repeat it here if it helps. Upon examining the thumb version of the function, I think it's not correct:
function printCustomSizedImageThumbMaxSpace($alt='',$width,$height,$class=NULL,$id=NULL) {
printCustomSizedImageThumbMaxSpace($alt,$width,$height,$class,$id, true);
}
Shouldn't that second occurence be "printCustomSizedImageMaxSpace" instead of "printCustomSizedImageThumbMaxSpace"? The function is currently calling itself.
--
Regarding the document, I'm hoping to get to it soon. I've been taking notes along the way, so that should help. I'm thinking that it should basically be a general help doc for people who live somewhere between completely non-technical and all you programmer types. It should also be useful to the completely non-technical folks, too.
I've decided that my first priority will be to get my own site finally functional, and then turn to the document. I haven't really joined any of the programmer discussions yet, but will hopefully turn to that when I start working on the doc.
okay - glad to hear that is fixed.
so... can you tell me if I'm interpreting MaxSpace correctly? My interpretation is that the function decreases the image size as far as it has to so that the height AND width are both lower than or equal to the inputs to the function. Further, the image is not cropped.
If this interpretation is correct, then I don't believe that the function is working properly. Is this a work-in-progress and should I just wait for a bit, or am I interpreting things incorrectly?
You are interpreting the function correctly, that is how it is meant to work. But indeed it still does not work 100% correctly.
It is still the nightly and with software in general, it is working properly until someone finds it is not...:-) I guess you need to wait a little more.
ok, thanks. for the record, it appears that the sizing portion of the function is not working properly. i'm getting all sorts of weird size results.
yep, using last night's build. still not working correctly.
here's a test gallery:
http://www.stanats.com/gal02/index.php?album=testalbum&image=07.jpg
look on the right for the number grid. the one on top uses my own functions, and the one on bottom, marked "MAXSPACE Version" uses the new functions. The images are supposed to max out at (120,100), but they don't.
The call I'm making is:
printCustomSizedImageThumbMaxSpace('',120, 100);
I've looked at the current code for the function and I haven't noodled all the way through it, but I think the sizing logic is faulty. I'm using this logic in my function:
if (getFullWidth()/getFullHeight() >= $width/$height)
/** then the image is relatively wider than the target size,
* so make it max width (height will be less than max) */
print(getCustomImageURL(null, $width));
else
/** then the image is relatively taller, so make it max height */
print(getCustomImageURL(null, null, $height));
This doesn't include the cases where $width or &height is not passed, but those simply fall into these same two categories. Obviously, the getCustomImageURL function can't be used by you guys in this situation since it doesn't deal with thumbs, but that's exactly why I'm waiting for this function.
Hope this helps!
Actually we know there is a bug somewhere. On a site I did I used this more (and perhaps overly) complicated code for the image on image.php but that was before we started to rework the maxspace functions. (500x380 is the size setting):
$percentuser = 550 / 100; $heightpercent = round(380 / $percentuser); $fullpercent = getFullWidth() / 100; $fullheightpercent = round(getFullHeight() / $fullpercent); if (getFullWidth() === getFullHeight() OR $fullheightpercent > $heightpercent) { printCustomSizedImage(getImageTitle(), null, null, 380, null, null, null, null, getImageID()); } else { printCustomSizedImage(getImageTitle(), null, 550, null, null, null, null, null, getImageID()); }
That is working but has not been tested with thumbs at all... These little functions really bug more than expected...:-)
um... yes, that does seem a bit heavier than necessary, but it also seems correct, unlike the current code.
simply, i think it makes most sense to use something like (syntax is wrong, but algorithm is the important part):
case
($width = 0 AND $height = 0) then error handling? or just full size?
($width = 0 OR (FullWidth/FullHeight >= $width/$height) then adjust to $height
else adjust to $width
i think that should do it.
wondering if this has been resolved and i should install a new nightly build...