Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0049076Openbravo ERP[POS2] Corepublic2022-04-14 10:462022-04-20 14:00
jmelin 
cberner 
highmajoralways
closedfixed 
5
 
PR22Q1.2PR22Q1.2 
Core
Production - Confirmed Stable
2020-11-09
https://gitlab.com/openbravo/product/openbravo/-/commit/f9de9389948227a1510d21a57811818a1e9c880c [^]
No
0049076: JIRA 2879 - Backoffice - can't import a bmp file
When trying to import a bmp file using an image import button
Then an error is triggered that said only jpg, png or bmp can be imported

So bmp can't be imported despite being an authorized type
Connect to back office
Open "Products" window and select any product
Try to import a bmp as product image

=> Error is triggered and image is not imported
No tags attached.
blocks defect 0049062 closed cberner JIRA 2879 - Backoffice - can't import a bmp file 
Issue History
2022-04-19 11:19cbernerTypedefect => backport
2022-04-19 11:19cbernerTarget Version => PR22Q1.2
2022-04-19 11:28hgbotNote Added: 0136583
2022-04-20 14:00hgbotResolutionopen => fixed
2022-04-20 14:00hgbotStatusscheduled => closed
2022-04-20 14:00hgbotNote Added: 0136635
2022-04-20 14:00hgbotFixed in Version => PR22Q1.2
2022-04-20 14:00hgbotNote Added: 0136636

Notes
(0136583)
hgbot   
2022-04-19 11:28   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/561 [^]
(0136635)
hgbot   
2022-04-20 14:00   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/561 [^]
(0136636)
hgbot   
2022-04-20 14:00   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 8e6d7e40de997c75399f89657cd9a9cc0fa4e142
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 19-04-2022 11:48:22
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/8e6d7e40de997c75399f89657cd9a9cc0fa4e142 [^]

Fixes ISSUE-49076: can't import a bmp file

After switching from using tika library to using the jdk URLConnection
guessContentTypeFromStream implementation to determine the mimetype of
an uploaded file, this broke. The URLConnection implementation is not
able to guess if a file is a bmp image or not, it will detect it as a
binary file. To fix this, if it is not detected using this API, ImageIO
API is used to try and read the file, if that's successful, then the
file is a bmp image file.

Regression introduced by commit 2d1e219013bf482f68d4c6809f367dcad8f28e7d

---
M src/org/openbravo/erpCommon/utility/MimeTypeUtil.java
---