Announcement

  •  » Extensions
  •  » Download By Size - not working on all albums

#1 2021-02-03 12:58:48

Jyskip
Member
2021-02-03
41

Download By Size - not working on all albums

Hello/Hi/Greetings,

I have the plugin installed "Download by Size" where it has "applied" for 2 out of 4 albums.
Im able to download in different formats from 2/4 albums but the two others it just download the raw photo format

Enviroment:
Piwigo 2.10.2 Check for upgrade
Operating system: Linux
PHP: 7.3.19-1~deb10u1 (Show info) [2021-02-03 12:57:39]
MySQL: 5.5.5-10.3.25-MariaDB-0+deb10u1 [2021-02-03 12:57:39]
Graphics Library: External ImageMagick 6.9.10-23

Last edited by Jyskip (2021-02-03 13:08:54)

Offline

 

#2 2021-02-04 14:38:37

Jyskip
Member
2021-02-03
41

Re: Download By Size - not working on all albums

Seems to have isolated the issue to be file specific.
Only files that are ".tif" cannot be converted for the purpose of using the "Download by Size" function..

Offline

 

#3 2021-02-04 20:08:53

Katryne
Member
2016-12-03
368

Re: Download By Size - not working on all albums

Hello !
I have always been taught that .tif files are not fit for the web and that they should be converted to .jpg beforehand.


http://photos.katrynou.fr/ v.14.1.0 https://album.chauvigne.info/ v.13.8.0
Système d'exploitation: Linux - Hébergeur 1&1-Ionos PHP: 8.0.28 - MySQL: 5.7.38
Bibliothèque graphique: External ImageMagick 6.9.10-23

Offline

 

#4 2021-02-04 23:36:24

erAck
Only trying to help
2015-09-06
2023

Re: Download By Size - not working on all albums

I doubt it's a general tiff vs jpeg problem, but rather that the plugin treats tiff special under some condition, see $permitted_non_picture in
https://github.com/plegall/Piwigo-downl … nc.php#L23
and following. Maybe the condition isn't as intended, though from a short glance it looks like a tiff is excluded from the early return.

Another possibility would be that for some reason $picture['current']['download_url'] is empty as if "the user has not access to the original" picture and
$conf['download_by_size_follow_enabled_high'] = true;
is set in the config.


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

Offline

 

#5 2021-02-08 08:58:31

Jyskip
Member
2021-02-03
41

Re: Download By Size - not working on all albums

Hello,

I don't see the paramters "$permitted_non_picture" in the main.inc.php

for Download By Size.

Can i just add it to the code?

Offline

 

#6 2021-02-08 11:47:00

erAck
Only trying to help
2015-09-06
2023

Re: Download By Size - not working on all albums

Apparently the code that can be downloaded as [extension by plg] Download by Size is not the same as the GitHub one linked to on that extension page and does not include the latest commit (now one year old) that exactly made this change:
[Github] Piwigo-download_by_size commit 70b8aa46

You can try to apply the patch (of course you backup the plugin first :p) in your installation, i.e.

Code:

cd plugins/download_by_size
curl https://github.com/plegall/Piwigo-download_by_size/commit/70b8aa4655561da9a336ca77ef949452917d18d4.patch | patch -p1

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

Offline

 

#7 2021-02-08 12:09:54

Jyskip
Member
2021-02-03
41

Re: Download By Size - not working on all albums

Hello,

I have runned the patch you mentioned on the Download_by_Size.

I can see from my config file that there are no

$conf['download_by_size_follow_enabled_high'] = true;

But i will try make it pregenerate some new pictures (if i can do it manually?)

Offline

 

#8 2021-02-08 12:43:29

erAck
Only trying to help
2015-09-06
2023

Re: Download By Size - not working on all albums

$conf['download_by_size_follow_enabled_high'] is unrelated to the patch, it has been there before and when set to true forbids to download any size if the user is not allowed to download the original size.


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

Offline

 

#9 2021-02-08 13:01:07

Jyskip
Member
2021-02-03
41

Re: Download By Size - not working on all albums

When i read about the "download_by_size" its not telling me how and when it will generate other formats from the orginal .tif file i will upload.

Can i force it to generate more files with the batch manager "generate multiple size images"?

Offline

 

#10 2021-02-10 15:56:12

Jyskip
Member
2021-02-03
41

Re: Download By Size - not working on all albums

When a .tif file is uploaded to the site / is allready there - how do i trigger download_by_size to convert it into multiple files for download?

I can do a batch manager where i can generate multiple sizes, but doesn't seems to work that way..

Offline

 

#11 2021-02-10 17:16:26

erAck
Only trying to help
2015-09-06
2023

Re: Download By Size - not working on all albums

I don't understand. What is the problem if the derivative to be downloaded is generated when it's actually needed? Note I don't even use that plugin..


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

Offline

 

#12 2021-02-11 08:15:20

Jyskip
Member
2021-02-03
41

Re: Download By Size - not working on all albums

Hello,

My problem is currently, that after making all this changes - and checking the exclusion list, it still cannot generate any other formats from the .tif files.

This is still the problem i am having. :-)

Code from main.inc.php

function dlsize_picture()
{
  global $conf, $template, $picture;

  // some non picture files (with a representative) are relevant for multiple
  // size download, so let's make exceptions
  $permitted_non_picture = array('tiff');

and from the config.inc.php file

<?php
$conf['tiff_representative_ext'] = 'png';
$conf['graphics_library'] = 'ext_imagick';

$conf['raw_jpg_quality'] = '60';
$conf['tiff_jpg_quality'] = '60';
$conf['browser_language'] = false;
$conf['guest_access'] = false;
$conf['random_index_redirect'] = array(
    PHPWG_ROOT_PATH.'index.php?/categories/20' => 'return true;'
    );
$conf['enable_i_log'] = true;
?>

Maybe its the ext_imagick that is not working as it should?

Offline

 

#13 2021-02-11 15:25:35

erAck
Only trying to help
2015-09-06
2023

Re: Download By Size - not working on all albums

Jyskip wrote:

My problem is currently, that after making all this changes - and checking the exclusion list, it still cannot generate any other formats from the .tif files.

This is still the problem i am having. :-)

Code from main.inc.php

Code:

  $permitted_non_picture = array('tiff');

You modified the original code that listed tif and tiff to not have tif anymore.. [Github] Piwigo-download_by_size commit 70b8aa46 has

Code:

  $permitted_non_picture = array('tif', 'tiff');

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

Offline

 

#14 2021-02-11 15:33:57

Jyskip
Member
2021-02-03
41

Re: Download By Size - not working on all albums

Hello,

I have made the code the original again.

I can see that .png, .jpg etc are making different sizes to download and having them in the pwg_representative

But currently im trying to make it do the same for .tif files - but cannot see how i can make that work, and troubleshooting this is not exactly easy.. :)

Offline

 

#15 2021-02-11 15:43:47

erAck
Only trying to help
2015-09-06
2023

Re: Download By Size - not working on all albums

Dumb question: did you apply the entire patch or just added the 3 lines you quoted?


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

Offline

 
  •  » Extensions
  •  » Download By Size - not working on all albums

Board footer

Powered by FluxBB

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