#1 2021-02-25 09:20:30

Jyskip
Member
2021-02-03
41

Download By Size - .TIF files

Hello/Hi/Greetings,

Yes, im bothering you all again - but now with a better question!
I have changed the settings in /include/config_default.inc.php

// 'png' or 'jpg': your uploaded TIF photos will have a representative in
// JPEG or PNG file format
$conf['tiff_representative_ext'] = 'jpg';

But some tiff files are still being generated as a .png - i have no other settings configured for generating .png so im curious what is going on here..

In the localEditor plugin i have commented this out, but don't seems to make any changes.

//$conf['tiff_representative_ext'] = 'jpg';
//$conf['graphics_library'] = 'ext_imagick';

Piwigo 2.10.2 Check for upgrade
Operating system: Linux
PHP: 7.3.19-1~deb10u1 (Show info) [2021-02-25 09:20:01]
MySQL: 5.5.5-10.3.25-MariaDB-0+deb10u1 [2021-02-25 09:20:01]
Graphics Library: ImageMagick 6.9.10-23

Piwigo URL: http://guldmann.billedarkiv.com/

Offline

 

#2 2021-03-09 09:30:31

Jyskip
Member
2021-02-03
41

Re: Download By Size - .TIF files

Nobody have any words to this? :-)

Offline

 

#3 2021-03-09 11:12:13

flop25
Piwigo Team
2006-07-06
7037

Re: Download By Size - .TIF files

Hello
don't change the default configuration but use Localfiles Editor to manage your own local configuration

if you used the value "ext_imagick" for "graphics_library", you need to add a value for "ext_imagick_dir". But if you converted tiff's that means you did it right

you are using a recent version of ImageMagick

Honestly I don't see what's wrong: Piwigo is telling to ImageMagick to create file which has $conf['tiff_representative_ext'] as extension. So if $conf['tiff_representative_ext'] is jpg, that should creates jpgs. Since you are changing core files, are you sure your changes in /include/config_default.inc.php have not been overwrite but an update?


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#4 2021-03-10 08:49:14

Jyskip
Member
2021-02-03
41

Re: Download By Size - .TIF files

Hello.

From what i can see - it primarly makes .jpg files, but still some .png are made.

https://i.imgur.com/PjtkXt1.png

But i can "try" changing the orginal file back, and uncomment the localfile editors entries?

Its just weird that im unable to find any lines in the configuration where it say "create .jpg but sometimes .png" :-)

Offline

 

#5 2021-03-10 09:50:44

flop25
Piwigo Team
2006-07-06
7037

Re: Download By Size - .TIF files

You *have to* install Localfiles, add your changes and then overwrite the /include/config_default.inc.php to the provided one in our zip.

about your issue, you can manually try to run the convert command as Piwigo does, asking for a jpg file, for one tiff among the one who are represented by a png.
I unfortunately don't know an easy way to regenerate the representative picture once the file uploaded... the process happens only at the upload to my knowledge. So you would need to delete and reupload.

Are you sure the png files were made with $conf['tiff_representative_ext'] = 'jpg'; set? and those waere deleted after preliminary tries and before retries...?


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#6 2021-03-10 11:37:16

Jyskip
Member
2021-02-03
41

Re: Download By Size - .TIF files

Hello Flop25,

Yes - i have tried multiple times to remove the .png files and recreate them using the batch manager.
It seems to be the same extact pictures getting generated as .png - not as .jpg

But i will try to "revert" my changes to the original config files and add the new lines in the localEditor

Offline

 

#7 2021-03-11 11:20:48

Jyskip
Member
2021-02-03
41

Re: Download By Size - .TIF files

Hello Flop25.

From what i can see that the pictures is generated in two directories?
https://i.imgur.com/uVqUC8J.png
https://i.imgur.com/L6q08Kh.png

Is this normal?
From what i can see from the generated .jpg files is not the same count?
https://i.imgur.com/10trAtK.png
https://i.imgur.com/AbYOhNZ.png

I can run the command in the shell "/_data/i/upload# find . -type f -name '*.png' -delete"
After i run the batch manager, i can see it will regenerate pictures again.
I have also changed the code back to the original in "/include/config_default.inc.php"

// 'png' or 'jpg': your uploaded TIF photos will have a representative in
// JPEG or PNG file format
$conf['tiff_representative_ext'] = 'png';

And added the code to localEditor

$conf['tiff_representative_ext'] = 'jpg';
$conf['graphics_library'] = 'ext_imagick';
$conf['ext_imagick_dir'] = '/usr/share/ImageMagick-6';

I have searched for the "ext_imagick_dir" you mentioned, but didn't seems to make any difference.
Just keeps generating .png for this exact files...

But maybe it can't do this to the .tif files?
Can't surely see that its .tif files getting generated as .jpg instead of .png..
Do we know how to make sure it can convert to the correct format?

Offline

 

#8 2021-03-11 11:47:17

flop25
Piwigo Team
2006-07-06
7037

Re: Download By Size - .TIF files

as stated in our Doc, which is unfortunately down currently, _data is where temporary files goes, so that's the derivative pictures (thmbnail, xl ...) you're seeing. There are made on the fly or by request on the Batch Manager

so that is nominal since the representatives are png:

I can run the command in the shell "/_data/i/upload# find . -type f -name '*.png' -delete"
After i run the batch manager, i can see it will regenerate pictures again.

I have also changed the code back to the original in "/include/config_default.inc.php"
And added the code to localEditor

perfect!

Can't surely see that its .tif files getting generated as .jpg instead of .png..
Do we know how to make sure it can convert to the correct format?

as I said, you can manually run the convert command as Piwigo does, asking for a jpg file, for one tiff among the ones who are wrongly represented by a png. Maybe ImageMagik fails at creating jpegs for some "special" tiff or that's a bug on that version of ImageMagik


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#9 2021-03-11 13:27:23

Jyskip
Member
2021-02-03
41

Re: Download By Size - .TIF files

Hello,

Do you have some documentation of the ImageMagick command that Piwigo is running?

Offline

 

#10 2021-03-11 15:25:35

flop25
Piwigo Team
2006-07-06
7037

Re: Download By Size - .TIF files

it starts here
[Github] Piwigo file admin/include/functions_upload.inc.php@L487

Code:

convert  -quality 98 "source_file" "destination_file_with_jpg_extension"

quite simple


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#11 2021-03-17 11:50:52

Jyskip
Member
2021-02-03
41

Re: Download By Size - .TIF files

Hello,

Thank you for the reply!
I will look into this..

Im just a bit curious about why it keeps selecting ".png" as a convert format instead of ".jpg" - do the mySQL database have something to do about this? Telling files where and which format it should do?

I have reverted my configuration changes made to original files, and ONLY using the localEditor client for changes.

It will be great to find a solution to this problem, due to i cannot find any link to why it keeps making .png - because its always the same files keeping get generated to ".png".

Offline

 

#12 2021-03-29 09:30:37

Jyskip
Member
2021-02-03
41

Re: Download By Size - .TIF files

flop25 wrote:

it starts here
[Github] Piwigo file admin/include/functions_upload.inc.php@L487

Code:

convert  -quality 98 "source_file" "destination_file_with_jpg_extension"

quite simple

Hello.
When i run this command manually - how do i get Piwigo to look at the new converted file, instead of the old one?

Offline

 

#13 2021-03-29 11:39:41

Jyskip
Member
2021-02-03
41

Re: Download By Size - .TIF files

Also..

I cannot find the "functions_upload" file?
So maybe this is where the error starts?

https://i.imgur.com/ZVIUpVu.png

Offline

 

#14 2021-03-29 11:46:51

erAck
Only trying to help
2015-09-06
2145

Re: Download By Size - .TIF files

Because you are looking in the wrong include directory, it is in admin/include/


Running Piwigo at https://erack.net/gallery/

Offline

 

#15 2021-03-29 11:56:24

flop25
Piwigo Team
2006-07-06
7037

Re: Download By Size - .TIF files

Jyskip wrote:

I cannot find the "functions_upload" file?
So maybe this is where the error starts?

you would have much more critical errors ^^
It's in /admin/include

Jyskip wrote:

When i run this command manually - how do i get Piwigo to look at the new converted file, instead of the old one?

you will be able to put the representative jpeg file along the png one, but I suspect there will be a manual database manipulation in order to reflect the png>jpeg change

But first, my point was to execute the same command as Piwigo does in order to find out where the problem lies; is it from piwigo, from IM ...?


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact