phpBB Gallery

Bug on Image File Extension - phpBB Gallery

Bug on Image File Extension

by Tarantino » Wed Mar 07, 2018 7:34 pm

With last phpBB Gallery when I'm on an image on gallery. Ex: "/app.php/gallery/album/9"
When I right click with mouse to save the image, the browser doesn't show the file extension, and it adds an "_" in the end. And I don't know if it's an jpg or png or bmp, etc.

EDIT: Basically the file extension doesnt appear for the /mini image
Tarantino
Registered User
Posts: 874
Joined: Sat Feb 18, 2012 1:51 pm
Contact:

Re: Bug on Image File Extension

by Tarantino » Wed Mar 07, 2018 7:38 pm

And I've found a typo:

'ACP_MEDIUM_DIR_STATE' => '<strong>./files/phpbbgallery/core/meduim/</strong> state',

should be /medium/ not /meduim/
Tarantino
Registered User
Posts: 874
Joined: Sat Feb 18, 2012 1:51 pm
Contact:

Re: Bug on Image File Extension

by Leinad4Mind » Sun May 12, 2019 6:57 pm

Today I had some time and I test this and in fact there is a bug on chrome and Edge/IE.

Example, my image title is: "Metropolis - City"

The chrome is the worse one since it doesnt't show the extension of the image when we try to download: "Metropolis - City_"
In Edge and IE the extension appears but the spaces are shown as %20: Metropolis%20-%20City.png
Firefox is OK: Metropolis - City.png

I don't know why this happens either. Intriguing.
Want to access all my portuguese MOD and Extension translations?
Become my Patreon!
phpBB Portugal Translator and Moderator
User avatar
Leinad4Mind
Translator
Posts: 863
Joined: Sun Jun 01, 2008 11:08 pm
Contact:

Re: Bug on Image File Extension

by Satanasov » Sun May 12, 2019 8:41 pm

Space spacial character and the way it is handled by browsers. Most special chars are... Meh at best. It's an encoding issue related to the way the data is transfered...

Solution will be to escape the special chatlrs.
For list of all my extensions go to https://github.com/satanasov
If you want custom functions in some of my products - PM me and we will discuss it.
Satanasov
Registered User
Posts: 1310
Joined: Sun Jul 29, 2012 5:48 am
Name: Stanislav Atanasov
Contact:

Re: Bug on Image File Extension

by Tarantino » Thu May 04, 2023 10:22 pm

After all this happens because when an image is not watermark one, on the display function on file.php the $this->tool->image_type is empty... so I added:

Code: Select all

	if(!$this->tool->image_type) {
			$this->tool->image_type = $this->tool->extension_by_filename($this->tool->image_source);
			if (!$this->tool->image_content_type)
			{
				trigger_error('NO_EXTENSION_MATCHED');
			}
		}
And created extension_by_filename that checks as the mime function and return the extension of the file. All working great now. But didnt found the root of the problem. Why the watermark image has image_type and not watermark image doesn't.
Tarantino
Registered User
Posts: 874
Joined: Sat Feb 18, 2012 1:51 pm
Contact:

Re: Bug on Image File Extension

by Neverlands » Mon May 08, 2023 8:14 pm

Tarantino wrote:After all this happens because when an image is not watermark one, on the display function on file.php the $this->tool->image_type is empty... so I added:

Code: Select all

	if(!$this->tool->image_type) {
			$this->tool->image_type = $this->tool->extension_by_filename($this->tool->image_source);
			if (!$this->tool->image_content_type)
			{
				trigger_error('NO_EXTENSION_MATCHED');
			}
		}
And created extension_by_filename that checks as the mime function and return the extension of the file. All working great now. But didnt found the root of the problem. Why the watermark image has image_type and not watermark image doesn't.
Hello Tarantino,
into which line did you put this code?
User avatar
Neverlands
Registered User
Posts: 117
Joined: Thu Sep 05, 2002 12:06 am
Location: Vienna / Austria
Contact: