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
Nobody have any words to this? :-)
Offline
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?
Offline
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
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...?
Offline
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
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
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
Offline
Hello,
Do you have some documentation of the ImageMagick command that Piwigo is running?
Offline
it starts here
[Github] Piwigo file admin/include/functions_upload.inc.php@L487
convert -quality 98 "source_file" "destination_file_with_jpg_extension"
quite simple
Offline
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
flop25 wrote:
it starts here
[Github] Piwigo file admin/include/functions_upload.inc.php@L487Code:
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
Also..
I cannot find the "functions_upload" file?
So maybe this is where the error starts?
https://i.imgur.com/ZVIUpVu.png
Offline
Because you are looking in the wrong include directory, it is in admin/include/
Offline
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 ...?
Offline