2018-08-16, 18:57:04
(This post was last modified: 2018-08-16, 19:07:25 by vanfruniken.)
(2018-08-11, 21:51:44)linden Wrote: Thanks but i forgot to mention that i am using "Multi image field" and also I dont know PHP
So I would greatly appreciate an example if anyone could help me.
Let me rephrase more precisely, with proper php syntax:
As far as I can tell (GS 3.3.13), thumbnails for each image, which should be located at
$image = '/GS/data/' . 'uploads/' . $path_to_imageFile . $imageFileName
are automatically generated in two sizes:
- either (as 200x200) $thumbnail = '/GS/data/' . 'thumbs/' . $path_to_imageFile . 'thumbnail.' . $imageFileName
- or (as 48x48) $thumbnail = '/GS/data/' . 'thumbs/' . $path_to_imageFile . 'thumbsm.' . $imageFileName
Up to you to extract the proper $path_to_imageFile and $imageFileName for each $image from your "Multi image field".
If you did store the complete $image in your "Multi image field", then
$thumbnail can be derived from $image by
- first replacing
'/data/uploads/' with '/data/thumbs/'
i.e.,
$partiallyFixedPath = str_replace('data/uploads/','data/thumbs',$image);
and
- also replacing
$imageFileName with 'thumbnail.' . $imageFileName or 'thumbsm.' . $imageFileName
i.e.,
$imageFileName = pathinfo($image)['basename'];
$thumbnail = str_replace($imageFileName,'thumbnail.'.$imageFileName,$partiallyFixedPath);
or
$thumbnail = str_replace($imageFileName,'thumbsm.'.$imageFileName,$partiallyFixedPath);
I am not myself fluent with the special fields plugins, so I can't help with that kind of details.
Hope this helps.