image_ratio_no_zoom_in not seeming to work

See all posts See thread Reply

Re: image_ratio_no_zoom_in not seeming to work new!
by Eric Poh, 13 years ago
Your Class is short of complete because of the following reasons

1) cant upload animated gifs

2) Sizing concerns when it cannot get the width and height prior to processing...

Many users like resizing their uploads where they constrain by either X or Y axis then apply the x or y image_ratio_ <- this logic is flawed.

Now here is the BIG@#$ problem:

Assume users would occasionally upload a portrait and occasionally a landscape image.

Dilemma: if he sets the x to fixed value and leave y auto ratio,
THEN the user will have problems when he uploads a portrait oriented image because all the portraits will appear significantly larger than the landscapes

Example A: Original file X=800 Y=600 (Landscape)
Constrain X to 400, Y to auto
Uploads and processed to X=400 Y=auto (which is 300)
Total pixels = 400X300=120,000

Example B: Original file X=600 Y=800 (Portrait)
Constrain X to 400, Y to auto (Same rule as above)
Uploads and processed to X=400 Y=auto (which is 534)
Total pixels = 400X534=213,600!!!!!

BUT then we have image_ratio_pixels right?
just set -> image_ratio_pixels=120000 problem solved?

Wrong then comes the problem when we have images that are smaller and we do now wish to scale due to loss of image quality, so u say just use -> image_ratio_no_zoom_in

BUT then you say "You can use only one of the image_ratio_* setting at the same time. "
$handle->image_ratio_no_zoom_in  = true;
$handle->image_y                 = 800;
$handle->image_x                 = 600;

Then we are just back to SQUARE ONE!Reply
Re: image_ratio_no_zoom_in not seeming to work new!
by colin, 13 years ago
Animated GIFs would require a complete rewrite of the class, as previously stated in the forum.

It is true that image_ratio_no_zoom_in and image_ratio_no_zoom_out are a problem since they cannot be used with other image_ratio_* settings. This will be fixed in a future version.

For the rest, I disagree. You can set image_x, image_y and image_ratio to constraint your image in set dimensions. Or you can use image_ratio_fill or image_ratio_crop to fit perfectly in these dimensions.

But also, before calling process(), you can can read image_src_x and image_src_y to accordingly set your settings. Basically, you can do your own logic before calling process, rather than having the class trying to work some magic which would likely not fit with everybody.

Does it answer your points?Reply