Textpattern CMS support forum

You are not logged in. Register | Login | Help

#351 2017-10-16 22:51:33

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,622
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

RedFox wrote #307387:

Default: 75… What does default mean?

If you set the profile’s quality to 75%, that’s the same as sliding the ‘quality’ slider to 75% when you export a JPG from some image manipulation program like Photoshop. It’s a trade-off between chucking pixels away (smaller filesize) and quality. If you crank it down to 25% the resulting image will be rather blocky or suffer from color banding, but might be good enough for a 50px square thumbnail. No good for a big image though. So you usually choose a high setting for large images.

What is your plugin doing BTW? Which engine is used to compress the images?

It uses the GD library to handle the file generation. Actually, it’s just a cheap wrapper for Txp’s internal thumb generation algorithms, which is why the plugin’s output control options are so basic. We only expose sharpness, quality and crop in core, so that’s all the plugin offers too.

Maybe if we implement ImageMagick one day, that’ll change. But for now, it’s limited to what you see in the plugin.

Hope that helps.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#352 2017-10-17 07:54:58

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 3,188
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Related issue regarding ImageMagick for reference.

Online

#353 2017-12-12 08:41:01

papalozarou
Member
Registered: 2004-07-05
Posts: 43

Re: smd_thumbnail: manage multiple thumbnails of your images

@Bloke – I have an issue where any landscape photo generates a thumbnail that’s rotated 90º anticlockwise. I’m generating 150 × 150 square, 75% quality, cropped, thumbnails.

Any ideas? Or an easy hack to fix?

Last edited by papalozarou (2017-12-12 08:41:46)

Offline

#354 2018-01-03 19:48:07

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 736
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

I’m trying to use smd_thumbnail and smd_macro with Flickity (slider) but I’m not successful.

To render a single image without Flickity I’m using:

<txp:figure id="4" caption="Ook de jeugd gooit hoge ogen" />
<figure>
<img src='<txp:smd_thumbnail id="{img_id}" type="650"><txp:smd_thumbnail_info item="url" /></txp:smd_thumbnail>' alt="Painting with egg tempera or acrylics on linen or paper" 
srcset='<txp:smd_thumbnail id="{img_id}" type="325"><txp:smd_thumbnail_info item="url" /> 325w</txp:smd_thumbnail>, 
<txp:smd_thumbnail id="{img_id}" type="650"><txp:smd_thumbnail_info item="url" /> 650w</txp:smd_thumbnail>, 
<txp:smd_thumbnail id="{img_id}" type="975"><txp:smd_thumbnail_info item="url" /> 975w</txp:smd_thumbnail>,
<txp:smd_thumbnail id="{img_id}" type="1300"><txp:smd_thumbnail_info item="url" /> 1300w</txp:smd_thumbnail>, 
<txp:smd_thumbnail id="{img_id}" type="1950"><txp:smd_thumbnail_info item="url" /> 1950w</txp:smd_thumbnail>'
sizes="(max-width: 768px) calc(100vw - 30px), 650px" />
<figcaption><txp:rah_replace from="<p>,</p>" to=","><txp:upm_textile lite="1">{caption}</txp:upm_textile></txp:rah_replace></figcaption>
</figure>

… and all is fine … :)

But what to do if I want to use the slider? This won’t work (of course):

<txp:slider id="4, 5, 6, 7" />
<div class="main-carousel">
<txp:images id="{img_id}" wraptag="ul" break="">
<li class="carousel-cell">
<figure>
<img src='<txp:smd_thumbnail id="{img_id}" type="650"><txp:smd_thumbnail_info item="url" /></txp:smd_thumbnail>' alt="Painting with egg tempera or acrylics on linen or paper" 
srcset='<txp:smd_thumbnail id="{img_id}" type="325"><txp:smd_thumbnail_info item="url" /> 325w</txp:smd_thumbnail>, 
<txp:smd_thumbnail id="{img_id}" type="650"><txp:smd_thumbnail_info item="url" /> 650w</txp:smd_thumbnail>, 
<txp:smd_thumbnail id="{img_id}" type="975"><txp:smd_thumbnail_info item="url" /> 975w</txp:smd_thumbnail>,
<txp:smd_thumbnail id="{img_id}" type="1300"><txp:smd_thumbnail_info item="url" /> 1300w</txp:smd_thumbnail>, 
<txp:smd_thumbnail id="{img_id}" type="1950"><txp:smd_thumbnail_info item="url" /> 1950w</txp:smd_thumbnail>'
sizes="(max-width: 768px) calc(100vw - 30px), 650px" />
</figure>
</li>
</txp:images>
</div>

Any help to make it render a slider is appreciated!

Last edited by RedFox (2018-01-03 19:58:56)

Offline

#355 2018-01-03 20:59:57

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,622
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

RedFox wrote #308546:

Any help to make it render a slider is appreciated!

You need to take out the id="{img_id}" references in the thumbnail tags. You only need the id="{img_id}" in the <txp:images/> tag and that then automatically feeds each ID to the tags inside it.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#356 2018-01-03 23:30:22

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 736
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Thanks @Bloke … and class=“main-carousel” on <txp:images> … and a corrupt flickity.js file … :o

Last edited by RedFox (2018-01-03 23:31:57)

Offline

#357 2018-03-11 09:15:33

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 216
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Batch Processing

Do I understand it correctly that batch processing is only done using the profile marked as ‘default’?

So, setting your desired profile temporarily to ‘default’ is the only way to batch process all (or selected) images with the profile of your choice?

It would be nice to be able to select a profile for batch processing.


JapaneseStreets.com – Japanese street fashion (mostly txp)
Old Photos of Japan – Japan between 1860 and 1940 (100% txp)
MeijiShowa – Stock photos of Japan between 1860 and 1940 (100% txp)

Offline

#358 2018-03-11 10:46:08

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,622
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Kjeld wrote #309890:

Do I understand it correctly that batch processing is only done using the profile marked as ‘default’?

Umm. Not sure. I thought it applied it across all profiles. Seems a bit strange to only batch create thumbs for the default profile. Maybe I did code it that way. Or maybe something’s broken. Are you on 4.6.2? Anything in debugging mode?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#359 2018-03-14 12:55:26

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 216
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Bloke wrote #309895:

Umm. Not sure. I thought it applied it across all profiles. Seems a bit strange to only batch create thumbs for the default profile. Maybe I did code it that way. Or maybe something’s broken. Are you on 4.6.2? Anything in debugging mode?

Thanks, Bloke! It seems I had it wrong. Must have been exhaustion… It does indeed create thumbs for all profiles at the same time.


JapaneseStreets.com – Japanese street fashion (mostly txp)
Old Photos of Japan – Japan between 1860 and 1940 (100% txp)
MeijiShowa – Stock photos of Japan between 1860 and 1940 (100% txp)

Offline

#360 2018-05-30 09:36:47

jpdupont
Member
From: Virton (BE)
Registered: 2004-10-01
Posts: 752
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Hello,
I have the following problem with 4.7.1 and the last php code of smd_thumbnail, uploaded with the Plugin Composer :
Can not create a new type of thumbnail.
I can delete, but not create. I got an error message about an index on “description”, if my site is in debug mode.
If I paste the php code of a version 4.0 beta of another site it’s ok. No more error message.

Notice "Undefined index: description"
in /home/xxxxx/webapps/commune/textpattern/lib/txplib_misc.php(1826) : eval()'d code at line 1364.

textpattern/lib/txplib_misc.php(1826) : eval()'d code:1364 adminErrorHandler()
textpattern/lib/txplib_misc.php:1945 smd_thumb_profiles()
textpattern/lib/txplib_misc.php:2145 callback_event()
textpattern/include/txp_image.php:260 pluggable_ui()
textpattern/include/txp_image.php:66 image_list()
textpattern/index.php:254 include()

Last edited by jpdupont (2018-05-30 09:38:29)

Offline

Board footer

Powered by FluxBB