1 (edited by jlinkels 12/27/2013 07:22:38 pm)

Topic: PNG Logo format not accepted

Version 2.3.19

When I upload an arbitrary file (not *.png, not *.jpg) as logo file in the company settings screen I see an error message: "The logo format must be PNG or JPG format".

This indicates either PNG or JPG format is accepted.

When I use a PNG file here, on invoices the company name disappears in the header, but the logo is not displayed. When I use a JPG file, the logo is displayed correctly. There is no error message while uploading the PNG file.

The label next to the "choose file" button does indicate "*.JPG". That is correct.

I would suggest to either correctly handle PNG format, or simply require *.JPG and not to accept the upload *.PNG. The functionality is a very minor issue, but it takes some time to figure out that the logo must be *.JPG.

jlinkels

2 (edited by apmuthu 12/28/2013 04:33:00 pm)

Re: PNG Logo format not accepted

The affected file for company is: admin/company_preferences.php

On checking the code, only .jpg seems to be referenced everywhere for display usage.

The above anomaly will probably be there for stock item images as well and the affected file here is: inventory/manage/items.php.

The help strings indicating file types other than .jpg to be allowed for upload are in the language .po files.

The stock item image file is referenced as .jpg in
reporting/rep104.php and
reporting/rep303.php

The database entry in sql/en_US-demo.sql refers to the company logo as:

INSERT INTO `0_sys_prefs` VALUES('coy_logo', 'setup.company', 'varchar', 100, 'logo_frontaccounting.jpg');

Re: PNG Logo format not accepted

PNG format is handled correctly in FA logos,a s well as *.jpg files. Maybe you have somewhat broken *.png file?
Some problems can be encountered only with files using transparent elements (e.g. log_frontaccounting.png in default theme - background is displayed in black), so shuch images should not be used here.

Janusz

Re: PNG Logo format not accepted

What I was referring to was the hard coded .jpg in the said php files. PNG is handled fine otherwise.