Skip to content

Commit

Permalink
added exif handling for jpg/jpegs in viewer and converter fixes #2691
Browse files Browse the repository at this point in the history
  • Loading branch information
iradraconis committed Nov 22, 2024
1 parent fe6d438 commit c1400df
Show file tree
Hide file tree
Showing 4 changed files with 858 additions and 7 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -710,12 +710,26 @@ public static JComponent getDocumentViewer(ArchiveFileBean caseDto, String id, S
return pdfP;

} else if (lFileName.endsWith(".jpg") || lFileName.endsWith(".jpeg") || lFileName.endsWith(".gif") || lFileName.endsWith(".png")) {
GifJpegPngImagePanel ip = new GifJpegPngImagePanel(content);
ip.setSize(width, height);
ip.setMaximumSize(new Dimension(width, height));
ip.setPreferredSize(new Dimension(width, height));
ip.showContent(id, content);
return ip;
try {
// EXIF-Orientierung verarbeiten
byte[] processedContent = ImageOrientationHandler.processImage(content);

GifJpegPngImagePanel ip = new GifJpegPngImagePanel(processedContent);
ip.setSize(width, height);
ip.setMaximumSize(new Dimension(width, height));
ip.setPreferredSize(new Dimension(width, height));
ip.showContent(id, processedContent);
return ip;
} catch (Exception ex) {
log.error("Error processing image", ex);
// Fallback auf ursprüngliche Implementierung
GifJpegPngImagePanel ip = new GifJpegPngImagePanel(content);
ip.setSize(width, height);
ip.setMaximumSize(new Dimension(width, height));
ip.setPreferredSize(new Dimension(width, height));
ip.showContent(id, content);
return ip;
}

} else if (lFileName.endsWith(".bmp") || lFileName.endsWith(".tif") || lFileName.endsWith(".tiff")) {
BmpTiffImagePanel ip = new BmpTiffImagePanel(content);
Expand Down
Loading

0 comments on commit c1400df

Please sign in to comment.