Scaling up images with a factor + run as non root user
Scaling by factor was only possible to scale down, as width & height :
- between 0 and 1 where considered as scale down factor
- greater than 1 was considered as absolute size in pixel
Now scaling up factor are supported with a new parameter z (zoom) changing the above behaviour to consider width&height greater than 1 as resizing factor as well.
The proxy must still be start with the option upScale set to true to allow this.
Another update made is that the go server will now execute as a non root user.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.
- If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
- If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
- In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.
Can you speak more about the motivation behind this change? Originally, imageproxy didn't scale up at all, since you could always just scale an image in CSS. The scaleUp option was only added because OReilly Media needed proxied images to fit an exact size. What's the case for needing to scale up by a factor of the original that can't be accomplished in CSS or by exact pixel values?
Our client in not web based and do not use CSS. It also makes sense to us to be able to scale up by factor if you can already scale down by factor.
Also if you don't want a any crop, keep the original ratio and don't know the orientation of the image (landscape/portrait), you can not scale up by providing w or h exact pixel value as you don't know what is the biggest side. In that case a scaling factor is better, at least for us.
Hope that make sense.