images icon indicating copy to clipboard operation
images copied to clipboard

"Without enlargement" (`&we`) allow enlargement for vectors

Open Rongronggg9 opened this issue 2 years ago • 2 comments

In most cases, we need to resize an image without enlargement is just because the enlargement does not bring any improvement. However, if the original image is a vector image (e.g., SVG, PDF), that's a whole different story.

What about adding a new param allow-vectors or only-raster to &we, resizing any raster images without enlargement, but in the meantime allowing vector images to be enlarged?

Rongronggg9 avatar Mar 07 '22 20:03 Rongronggg9

We do not plan to add dedicated option values to our API that could produce a different image based on the image type, as that would certainly over-complicate things and cause confusion (even if it is opt-in).

Aside from this being an uncommon use case, is there a reason why you can't just omit the &we option when resizing vector-based images?

kleisauke avatar Mar 10 '22 19:03 kleisauke

We do not plan to add dedicated option values to our API that could produce a different image based on the image type, as that would certainly over-complicate things and cause confusion (even if it is opt-in).

OK. I agree with you.

why you can't just omit the &we option when resizing vector-based images?

If you just get tons of external URLs, but no more information about these images, sometimes it is hard to guess their format from the URLs. The only way is to fetch their response headers to get the Content-Type, which slightly increases the server loads.

Rongronggg9 avatar Mar 10 '22 21:03 Rongronggg9

Closing for the reasons stated above.

Feel free to implement this feature and running the source code yourself.

kleisauke avatar Nov 17 '22 10:11 kleisauke