Hi!
I'm setting up a new gallery - currently just a vanilla installation, no plugins or customisations yet. Default modus theme.
I have a set of (several thousand) PNG images and associated thumbnails that I wish to use. The thumbnails are NOT simply resized main images, but are a selected region of the larger image. Sizes of both images vary wildly, depending on the original content. I do NOT want a resized image in the gallery views, simply because they would be too small in most cases to discern the contents. (Some main images are particularly large.)
I have used the ftp/synchronise option to import a sample of the images which works, but I am struggling in how to use the thumbnail images I have in the main gallery display. I've tried putting them in subfolders 'thumbnail' and 'pwg_representative' before doing the sync, but to no effect.
Is there something I am missing or is it not possible to override the automatic thumbnail generation on import? I am happy to run some further processing on the thumbnails to regularise the sizes if it helps.
Thanks
AJ
Offline
In some upload context it is possible to shove thumbnail representatives in a pwg_representative subdirectory, so for path/filename.ext have path/pwg_representative/filename.jpg (meant for non-image file formats). But I have no idea if and how that would work with / survive a "ftp" directory sync. If there is such then the representative's file name extension is stored in table piwigo_images column representative_ext.
Offline
For an image
galleries/path-to/file.ext
the thumbnail is
_data/i/galleries/path-to/file-th.ext
Offline
Those _data/i/... thumbnails are generated though and when regenerating may get overwritten. They are also generated for .../pwg_representative/*.jpg files.
Offline
Thank you; loading the thumbnails in there with that name worked, in the sense it's now using them.
BUT it's still displaying them in the same proportions as the original image, not using the thumbnail proportions. (e.g. main image is 590x7852, tall and skinny, whereas my thumbnail is 65x148, so a little more reasonable. However it is constrained to a cell 10x144 ... I've tried digging through the source and themes but haven't yet worked out where it's specifying this .
Edit:
I found and edited include/derivative.inc.php, class DerivativeImage, function get_size to:
function get_size() { $r = @getimagesize(PHPWG_ROOT_PATH.$this->rel_path); if (is_array($r)) return $r; if ($this->params == null) { return $this->src_image->get_size(); } return $this->params->compute_final_size($this->src_image->get_size()); }
This may or may not be a good way to deal with this, but it seems to work for me ...
Last edited by AJDesigns (2021-10-14 00:54:06)
Offline
Ok, your "BUT" is only concerning mobile SmartPocket theme, as replacing thumbnails files is enough to make it works as you want for elegant theme (without editing code).
Offline
Thank you.... I'm obviously new to this. Checking other themes now too. :)
Offline