pqina / filepond-plugin-image-resize

🖼 Add image resize instructions to files dropped on FilePond
https://pqina.nl/filepond
MIT License
8 stars 2 forks source link

Image resize plugin is incorrectly setting resize metadata when imageResizeMode is 'cover' #6

Open tomdav999 opened 3 years ago

tomdav999 commented 3 years ago

Describe the bug The Image resize plugin is incorrectly setting resize metadata when imageResizeMode is 'cover' leading to token image transformation and file compression of originals when no resize should occur.

Logs n/a

To Reproduce 1) set the following resize options:

imageResizeMode: 'cover' 
imageResizeTargetHeight: 300
imageResizeTargetWidth: 300
imageResizeUpscale: false

2) upload a 600 x 200 image

3) check uploaded filesize and dimensions

Expected behavior Image should not be resized original file should be uploaded (unless some other transformation is required)

Actual behavior Image dimensions do not change (good) Uploaded filesize is different due to token transformation and compression (bad)

Information about your project: Windows 10, latest filepond, latest firefox

Additional context image resize plugin should account for shortest side when imageResizeMode is 'cover'

rikschennink commented 3 years ago

Just published new version of the plugin that omits the resize metadata if one of the edges is smaller, will probably not fix it since the actual transformation happens in transform, but it's a good start.

natsumework commented 3 years ago

Just published new version of the plugin that omits the resize metadata if one of the edges is smaller, will probably not fix it since the actual transformation happens in transform, but it's a good start.

I use the following settings { imageResizeTargetHeight: 1920, imageResizeTargetWidth: 1920, imageResizeMode: 'contain', imageResizeUpscale: false } to ensure that the height and width are both below 1920. But the changes in version 2.0.9 cause it will not resize as long as the height or width is less than 1920.

rikschennink commented 3 years ago

@natsumework should be fixed in 2.0.10