Am 03.09.2013 14:22, schrieb Thomas Tanghus:
>
> In ajax/savecrop.php:
>
> > @@ -76,8 +77,8 @@
> >  			'savecrop.php, x: '.$x1.' y: '.$y1.' w: '.$w.' h: '.$h,
> >  			\OCP\Util::DEBUG);
> >  		if($image->crop($x1, $y1, $w, $h)) {
> > -			if(($image->width() <= 200 && $image->height() <= 200)
> > -				|| $image->resize(200)) {
> > +			if(($image->width() <= $max_size && $image->height() <= $max_size)
>
>     I suppose this is due to the fact that the app only wanted to
>     store 200px images
>
> Exactly. I first resize the image to max 400px to have a reasonable
> size in the crop dialog. As mentioned in the comments elsewhere, GD
> also apparently does a better job of resizing than the browser, you
> transfer less data and you don't have to calculate the crop based on
> the original size.
>
>     or do not resize at all since we cannot know how small the part is
>     the the user want to crop/cut out.
>
> The user could upload a 400x2000 px image, so we have to do some resizing.
>
But the user could also upload a 4000x3000px group photo and only wants
to use the head of one person which then would be about 300x200px. If we
resize the photo to 400x300px first the resulting cropped image will be
only 30x20px.

Do you think it is easy to let the browser send the maximum height &
maximum width it can display to so the user can view it full screen and
we save as much traffic as possible, and then use the resulting crop
rectangle and apply it on the original image (we would need some
calculation here)?