Re:image resize problem (squeeze) (1 viewing) (1) Guest
Favoured: 0
|
|
|
TOPIC: Re:image resize problem (squeeze)
|
0zz1 (User)
Senior Boarder
Posts: 43
|
|
Re:image resize problem (squeeze) 11 Months, 1 Week ago
|
Karma: 1
|
http://homeinasia.com/0zz1/proportions.jpg
Im sorry my German sucks bit time, but I have the exactly same configurations but it does not work.
If I upload vertical pictures it will stretch them into 450px wide and 338px height. Also the individual image settings does not work, if I try to use them it always drops me out from the bind & upload. At least with Firefox with Safari the whole admin does not work and I do not have IE as Im on mac, but does it work any better with that?
perhaps this is to do with php5 ??? meaning it does not work with php5 ?
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
rom (User)
Fresh Boarder
Posts: 1
|
|
Re:image resize problem (squeeze) 7 Months, 2 Weeks ago
|
Karma: 0
|
hi,
In my version 1.1.0, i found two problems :
- first one, the keep proportion parameter value is never "1" so pictures will always stretch them into fixed size.
- second one, "vertical" pictures are squeezed because of the wrong calculated ratio
here is the code to be replaced:
com_estateagent/includes/gallery/upload.gallery.php
l50 :
replace
| Code: |
$cfg['imageprtn']=(isset($cfg['imgprtn']))? 1 : 0;
|
by
| Code: |
$cfg['imageprtn']=$ea_imgprtn;
|
l56 :
replace | Code: |
$cfg['thumbprtn']=(isset($cfg['tbprtn']))? 1 : 0;
|
by
| Code: |
$cfg['thumbprtn']=$ea_tbprtn;
|
l181:
replace
| Code: |
$ratio = $srcWidth / $width;
|
by
| Code: |
if($srcWidth<$srcHeight)
$ratio = $srcHeight / $width;
else
$ratio = $srcWidth / $width;
|
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
|
|
|
Re:image resize problem (squeeze) 7 Months ago
|
Karma: 1
|
I think in case of small pictures it is important that the upload.gallery.php should use $destWidth and not $width. So I did the following two little changes:
In line 211 the code...
| Code: |
imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $width, (int)$destHeight, $srcWidth, $srcHeight);
|
is replaced by:
| Code: |
imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, $destHeight, $srcWidth, $srcHeight);
|
in line 243 code...
| Code: |
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $width, (int)$destHeight, $srcWidth, $srcHeight);
|
is replaced by:
| Code: |
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $destWidth, $destHeight, $srcWidth, $srcHeight);
|
Now your small pictures should keep small, so that we don't have to view great pixels. Larger pictures are resized down to the allowed maximum. Besides everything keeps in proportion if you took care about the $prop=0 bug too (also mentioned in this thread).
Besides the maximum Width is checked but not the maximum Height. So if I allowed uploads of 640 width and 480 height it would be posiible to upload 640 width and 2000 height for example. You may solve it by
replacing line 182...
| Code: |
$ratio = $srcWidth / $width;
|
with...
| Code: |
$ratiowidth = $srcWidth / $width;
$ratioheight = $srcHeight / $height;
$ratio = max($ratiowidth,$ratioheight);
|
If you set size to 800x800 now, your users can upload 800x600 and 600x800 for example.
Eine kleine Frage noch meinerseits: Weiß jemand schon, wann ME über die wichtige OpenImmo-Schnittstelle verfügen wird? ME bringt mir leider ohne OpenImmo überhaupt nichts.
Grüße
Stefan Pappenberg
http://wohnungen-immobilien-makler-berlin.de<br><br>Post edited by: pappenberg, at: 2007/12/17 16:02
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
BMPT (User)
Junior Boarder
Posts: 26
|
|
Re:image resize problem (squeeze) 7 Months ago
|
Karma: 0
|
|
Ok so this last fix solved all the problems i think... but the thumbnail lost a lot of quality? why? on admin i have it at 100% and before this the thumb had a good quality, so what happened?
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
|
|
|
Re:image resize problem (squeeze) 6 Months, 3 Weeks ago
|
Karma: 1
|
@BMPT: What happens, if you change Line 53 of upload.gallery.php temporarely
from
| Code: |
$cfg['createTb'] = (isset($cfg['createthumb']))? 1:0;
|
into
| Code: |
$cfg['createTb'] = 1;
|
and then upload some pictures. Do you have better thumbnail resolution then?
Don't see this as a solution! I just want to know what happens at BMPT's homepage if his thumbs are definately set to be created!
Merry Christmas and a happy new year
Stefan Pappenberg
http://www.wohnungen-immobilien-makler-berlin.de<br><br>Post edited by: pappenberg, at: 2007/12/26 13:04
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
0zz1 (User)
Senior Boarder
Posts: 43
|
|
Re:image resize problem (squeeze) 5 Months, 2 Weeks ago
|
Karma: 1
|
|
thank you pappenberg I got the vertical pics in, but im having same problem that the vertical pic thumbnails are bad quality and also too big... any ideas anyone ??
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
|
|
|
|
|