View previous topic :: View next topic |
Author |
Message |
egbert02 Newbie
Joined: 03 Jan 2007 Posts: 1
|
Posted: Tue Jan 09, 2007 4:35 pm Post subject: SetMaxDisplaySize doesn't always work correctly |
|
|
Hi!
First I would like to say thanks for your great work! This script is exactly what I have been looking for.
I'm planning to use it on a commercial website and I will gladly pay for it
(if I figure out how to use PayPal ). I'll send you an email in the near future with further details.
But unfortunately there seems to be an issue with SetMaxDisplaySize. I set it to 600x600 and if I use your script with an image, which is higher than wide and bigger than SetMaxDisplaySize (e.g. 900x1200) everything is fine, the area for CropImage is scaled to ?x600 (where ? is <600).
But if I use it with an image, which is wider than high and bigger than SetMaxDisplaySize (e.g. 1200x900), the area for CropImage is scaled to ?x600 (where ? is >600). But this is not correct, it should be scaled to 600x? (where ? is <600).
Any help is really appreciated!
Thanks and greetings from Germany
Tom |
|
Back to top |
|
 |
amnuts Site Admin

Joined: 01 Sep 2002 Posts: 662 Location: East Sussex, England
|
Posted: Tue Jan 16, 2007 10:46 am Post subject: |
|
|
Hi, and welcome to the board!
I see what you mean... Damn, I thought I had tested it with both a landscape and portrait image. I guess I'm just missing a check for which dimension is bigger... I'll try to investigate some time soon.
In the meantime, if you want to play around with things then check out the loadInterface method. It'll be around this chunk of code that you want to tweak:
PHP: | <?php if (!empty($this->crop['max-display'])
&& ($this->img['sizes'][0] > $this->crop['max-display'][1]
|| $this->img['sizes'][1] > $this->crop['max-display'][2])) {
if ($this->crop['max-display'][1] > $this->crop['max-display'][2]) {
$this->crop['max-display'][2] = round($this->img['sizes'][1] / ($this->img['sizes'][0] / $this->crop['max-display'][1]));
} else {
$this->crop['max-display'][1] = round(($this->crop['max-display'][2] / $this->img['sizes'][1]) * $this->img['sizes'][0]);
}
$this->crop['max-display'][0] = $this->crop['max-display'][1] . 'x' . $this->crop['max-display'][2];
$this->crop['max-display'][3] = $this->img['sizes'][0] / $this->crop['max-display'][1];
$this->img['sizes'][0] = $this->crop['max-display'][1];
$this->img['sizes'][1] = $this->crop['max-display'][2];
} else {
$this->crop['max-display'] = array();
} ?> |
Andy |
|
Back to top |
|
 |
w2felix Newbie
Joined: 01 Jul 2007 Posts: 2
|
Posted: Sun Jul 01, 2007 6:59 pm Post subject: |
|
|
Hi There!
I have the same problem, but i can't imagine which operators to swap, so the right image resolution will appear.....
But I've also another problem..
The line: Crop size: 292 / 158
if the function: $ci->setMaxDisplaySize('300x300');
is enabled, the crop size value refers to the reduced image size, and not to the original image size... e.g.:
i've an image 1024x860
if i'll load it with crop canvas, the size is reduced to 400x300
that's no problem at all...
but if i select half of the image, the Crop size labels: 200 / 150
the croped image is 512x430... ok, but is it possible, that the crop size label refers to the original image size? so if i select half of the image:
Crop size: 512x430, instead of 200 / 150
i hope you understood what i wanted to say... |
|
Back to top |
|
 |
w2felix Newbie
Joined: 01 Jul 2007 Posts: 2
|
Posted: Mon Jul 23, 2007 12:06 pm Post subject: |
|
|
sorry, does anybody know a solution for my problem? |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|