In Frappe V14, a new feature was added to automatically crop an image during the upload process. As far as I can tell, if the image to be uploaded is the document image, the aspect ratio of the crop is forced to 1:1.
For the Website Item doctype, this is not necessarily useful as the document image appears on the web-site to represent the product. All our product images are 4:3 (640x480 px) and in V14 we cannot upload these images without 25% being cropped off them.
Having looked in the code I cannot see a built-in mechanism for the user to bypass the crop. If I have missed it and someone can point it out to me I would be very grateful.
If there is no way to bypass it, I think the crop should not apply to the Website Item doctype so a way to disable it for any particular doctype would be required.
It looks like the 1:1 constraint exists only for images designated as the “Image Field” under Form Settings. If you Customize Form and scroll to the bottom, you can un-designate the image field. Once you do that, any image you upload can have any crop ratio (or none at all)
Thank you, Peter. Yes, that works, although of course the user loses the convenient document image visible on the form. The same customisation would need to be applied to the Item doctype too, since creating a Website Item from an Item copies the image (or the reference to the image) from one document to the other. Perhaps the proper approach involves revisiting the Website Item document in ERPNext to take account of the new way of doing things in Frappe and not to make any assumptions about the usability of the document image (perhaps use a separate attachment for the website image). I might make a suggestion on GitHub once I’ve thought it through a bit more.
When the cropping is optional I like the feature, although we’ll probably seldom use it as all our product photos are pre-processed prior to upload. It’s just the forcing of the aspect ratio for the document image that has broken things in ERPNext that worked prior to V14.