-
Notifications
You must be signed in to change notification settings - Fork 803
Thumbnail generation fails for certain image types #223
Copy link
Copy link
Open
Description
Description:
I have encountered an issue where the library fails to generate thumbnails for specific types of images. Below are the details:
• Problem: When trying to create thumbnails for certain image files, the process fails and no thumbnail is generated.
• Image Types Affected: PNG (in attach)
• Error Details: no errors, but the file is not saved
• Steps to Reproduce:
InputStream is = new BufferedInputStream(img.getBinaryStream())
def result=Thumbnails.of(is).size(width, height).asBufferedImage()
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(result, "jpeg", os);
// Passing: (RenderedImage im, String formatName, OutputStream output)
InputStream fis = new ByteArrayInputStream(os.toByteArray());
Connection conn = dataSource.getConnection()
PreparedStatement pst
if (isMax) pst = conn.prepareStatement("UPDATE FILES SET thumbnail_max = ? WHERE ID = ?")
else pst = conn.prepareStatement("UPDATE FILES SET thumbnail = ? WHERE ID = ?")
//= conn.prepareStatement("UPDATE FILES SET thumbnail = ? WHERE ID = ?")
pst.setBinaryStream(1, fis, fis.available())
pst.setLong(2, image.id)
def index = pst.executeUpdate()
pst.close()
conn.close()
Environment:
• Library version: 0.4.20
• Operating System: MAC OS X /LINUX
• Programming Language and Version: GRAILS 4
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
