Ebay now requires images to be 500×500.
I want to try to use ImageResizer to resize an image to be a minimum of 500×500 by adding white background padding
The following command achieves this quite easily.
product.jpg?width=500&height=500&scale=canvas
This works great, except when the original image is 800×800 and it will be downsized and lose quality.
What I really want to do is combine scale=canvas
with scale=upscaleonly
but that doesn’t seem to be possible? Am I missing something or will I have to write code myself using the API.
PS. I realize ebay may detect whitespace and still reject the image, but I’m trying that for now – I have a lot of perfectly good 450×450 images that fall short and I don’t want to upscale them.
2
Answers
I haven’t used ImageResizer before, but I’ve worked with images, so I took a quick peek at the basic commands for ImageResizer.
If I understand your problem correctly, when you downsize a 800×800 image it looses quality. This does point to a severe problem because the original image has more data than what is needed to display a high quality 500×500 image. Because of this, we must look at the image file format type and the data compression quality/method.
In your example, you are using the JPEG file format. You may want to specify the format in the command, i.e., format=jpg
In using the JPEG format, Imageresizer gives you control over the quality of the compression:
The documentation states:
Take a look at the documentation for the exact verbage for setting the quality.
At present, there’s no ‘upscalecanvasonly’ mode.
So far we haven’t had anyone else request this, but feel free to add it to our UserVoice site as a feature idea.
You could also implement this with a small IPlugin that subclassed BuilderExtension and implemented LayoutImage to support an additional command. It shouldn’t be very difficult.