Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0049075Openbravo ERP[POS2] Corepublic2022-04-14 10:462022-04-20 14:00
jmelin 
cberner 
highmajoralways
closedfixed 
5
 
PR22Q2PR22Q2 
Core
Production - Confirmed Stable
2020-11-09
https://gitlab.com/openbravo/product/openbravo/-/commit/f9de9389948227a1510d21a57811818a1e9c880c [^]
No
0049075: 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 => PR22Q2
2022-04-19 11:30hgbotNote Added: 0136584
2022-04-20 14:00hgbotResolutionopen => fixed
2022-04-20 14:00hgbotStatusscheduled => closed
2022-04-20 14:00hgbotFixed in Version => PR22Q2
2022-04-20 14:00hgbotNote Added: 0136637
2022-04-20 14:00hgbotNote Added: 0136638

Notes
(0136584)
hgbot   
2022-04-19 11:30   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/562 [^]
(0136637)
hgbot   
2022-04-20 14:00   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 280b2f81703961e4b79d78b0641d260f71c86d14
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 19-04-2022 11:47:36
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/280b2f81703961e4b79d78b0641d260f71c86d14 [^]

Fixes ISSUE-49075: 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
---
(0136638)
hgbot   
2022-04-20 14:00   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/562 [^]