volunteer-portal icon indicating copy to clipboard operation
volunteer-portal copied to clipboard

Expedition image resize has jpg hardcoded

Open cdausmus opened this issue 2 years ago • 0 comments

When uploading an expedition image that is not a jpg, an error occurs:

2022-08-09 09:44:14.056 ERROR --- [nio-8080-exec-5] au.org.ala.volunteer.ProjectService      : Could not check and resize expedition image for Testing Field Notes

javax.imageio.IIOException: Invalid argument to native writeImage
        at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeImage(Native Method)
        at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeOnThread(JPEGImageWriter.java:1067)
        at com.sun.imageio.plugins.jpeg.JPEGImageWriter.write(JPEGImageWriter.java:363)
        at javax.imageio.ImageWriter.write(ImageWriter.java:615)
        at javax.imageio.ImageIO.doWrite(ImageIO.java:1622)
        at javax.imageio.ImageIO.write(ImageIO.java:1548)
        at javax.imageio.ImageIO$write$1.call(Unknown Source)
        at au.org.ala.volunteer.ProjectService.$tt__checkAndResizeExpeditionImage(ProjectService.groovy:656)

Allow other image formats (png etc) and remove hard coding.

cdausmus avatar Aug 09 '22 00:08 cdausmus