![]() |
|
landscape thumb of portait img distorted - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: landscape thumb of portait img distorted (/thread-6225.html) Pages:
1
2
|
landscape thumb of portait img distorted - breglis - 21-01-2010 hi, To me the function should always shrink any image to fit the width of the thumb and then cut off from the height to match the height Is there a quick solution for this? landscape thumb of portait img distorted - acrylian - 21-01-2010 You need to experiment a little with the additional parameter of the crop functions (width and height need to be set to crop) and best also clear the image cache. Please do a forum search we had a lengthly thread about that some time ago as far as I remember. Also look at the i.php file and the comments within it. landscape thumb of portait img distorted - breglis - 22-01-2010 thanks for the reply. I had a good read through other threads but I have not come to an conclusion yet on how to work round the problem and I always look at the images directly to rule out CSS I also discovered it to be a general problem with both landscape and portrait pictures Ideas anyone? landscape thumb of portait img distorted - acrylian - 22-01-2010 Try setting the cropwidth and height bigger than the width and height. landscape thumb of portait img distorted - breglis - 22-01-2010 no, that didnt work. I tried varies things including setting cropwidth and cropheight to getWidth(). landscape thumb of portait img distorted - acrylian - 22-01-2010 I am sorry I have no idea. Did you try to create a custom thumb using the crop tool and then assign that as an album thumb? landscape thumb of portait img distorted - breglis - 22-01-2010 i am trying to analyse propsize and cacheimage function as I am convinced that these functions are not working right to cut landscape thumbs out of portrait images. How do i activate DEBUG_IMAGE for logging? landscape thumb of portait img distorted - sbillard - 22-01-2010 You change the define. If you didn't think of doing a search on that identifier, maybe you should consider if you will be able to understand the rest of the code.... landscape thumb of portait img distorted - breglis - 24-01-2010 thanks for the reply even though I could take less of your ego... landscape thumb of portait img distorted - sbillard - 24-01-2010 Not so much ego as frustration with people who don't even attempt to answer their own questions. I could take MUCH less of that. landscape thumb of portait img distorted - breglis - 25-01-2010 the frustration is understandable as a ZP alumni, but instead to affront define('DEBUG_IMAGE', false); -> functions-basic.php l 17 so that it can be found through the search function I really appreciate your work ! landscape thumb of portait img distorted - acrylian - 25-01-2010 Well, as we all know sometimes written text comes out differently as meant. I agree that we probably should have a troubleshooting entry on how to enable the debug logs. landscape thumb of portait img distorted - breglis - 25-01-2010 with the help of the DEBUG I got to the bottom of the thumbnail issue and have identified a bug. The distortion is the result of incorrectly calculated $cw & $ch in there. This bug can somehow be worked arround by setting the cropping width&height equal to the thumb width&height. But this then results into the described 'zoom' effect through the way the native php function 'imagecopyresampled' works. My question know is why the cropwidth & cropheight are handed into the core function from ZP at all? In my eyes it would make more sense to calculate the cropwidth & cropheight required on the fly instead by simply comparing image dimensions to desired thumb dimension and calculate the best fitting thumb that way ? Is there a specific reason cacheImage works this way for other uses ? landscape thumb of portait img distorted - sbillard - 25-01-2010 Quote:My question know is why the cropwidth & cropheight are handed into the core function from ZP at all? In my eyes it would make more sense to calculate the cropwidth & cropheight required on the fly instead by simply comparing image dimensions to desired thumb dimension and calculate the best fitting thumb that way ? What do you mean by "on the fly" calcualtions? I would take this to mean as the script loads, which is exactly what happens. Anyway, maybe you should share your trace information and how you are setting up the image. Then perhaps we can see what is going wrong. landscape thumb of portait img distorted - breglis - 25-01-2010 using on 500x336 landscape image creates an overly cropped but portrait pictures are not distorted. However the portrait pictures 336x210 get distorted if I use printCustomAlbumThumbImage($gallery_title,'','200','113','','',Null,Null,'',''); check these example: http://www.bregler.net/backup/view.php What I mean with on the fly is why the $cropw, $croph are there at all ? landscape thumb of portait img distorted - breglis - 25-01-2010 . landscape thumb of portait img distorted - sbillard - 25-01-2010 Quote:What I mean with on the fly is why the $cropw, $croph are there at all ? Seems what you desire is pretty much what is done by the Efferevescence+ theme: i'm not certain why your first call overly cropped the image. Have to look into that. The second one, though said "create a 200x113 image from the original" (no cropping). Naturally that would be a distorted image. landscape thumb of portait img distorted - breglis - 25-01-2010 here is the extract of the really extreme cases of bad thumbs: www.bregler.net/backup/log.txt I quickly configured the examples here : http://www.dev.bregler.net/gallery/ landscape thumb of portait img distorted - breglis - 25-01-2010 yeah I tested the null,200,null,200,113 combination, compare: http://www.dev.bregler.net/gallery/2000/Wolf_und_Hilal__Hamburg__2000__pbh.jpg.php the problem is exactly the same as decribed in my debug log Which is a bug I believe to be in the cacheImage function landscape thumb of portait img distorted - breglis - 26-01-2010 for now I have duplicated the cacheImage in a custom function the current code is not ready to create portrait thumbs from landscape images and vice versa to do this $cr = min($w, $h)/$ts; (line 135) has to be replaced with if ($neww > $newh) $cr=$w/$ts; else $cr=$h/$ts; What do the local developer heros say? |