Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2010-11-10 10:35:28

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

Re: smd_thumbnail: manage multiple thumbnails of your images

zero wrote:

Feasible?

I think so. Will see if I can find time to fix it today.

No point having cake if you can’t eat it :-)

Last edited by Bloke (2010-11-10 10:35:57)


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

#22 2010-11-10 11:25:31

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

Re: smd_thumbnail: manage multiple thumbnails of your images

Creating a TXP thumb at the same time as the default profile thumb is created seems trivially easy. Untested at the moment but I just wrote the code to do it and don’t foresee any issues (famous last words).

Question: what happens when you delete a thumbnail designated as the default profile? Should it also delete the TXP thumb, or leave it alone? My gut instinct says to delete it as well, even though that will kill <txp:article_image thumbnail="1" /> and <txp:thumbnail /> tags. After all, if you delete a thumb from TXP’s regular interface then that has the same effect.

Everyone concur or have I got it wrong?


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

#23 2010-11-10 11:34:19

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,138
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

I’d say don’t delete the txp thumb. Replace it by all means with a new default profile thumb, but is it doing any harm if it is not deleted from the images folder?

EDIT: I don’t mean automatically replace txp thumb with new default profile thumb, but only replace it if user chooses to do so.

Last edited by zero (2010-11-10 11:41:23)


TXPQ Examples and discussion of Textpattern CMS quality.
Safe Reiki Harmless natural healing.

Offline

#24 2010-11-10 11:53:14

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

Re: smd_thumbnail: manage multiple thumbnails of your images

zero wrote:

I’d say don’t delete the txp thumb. Replace it by all means with a new default profile thumb, but is it doing any harm if it is not deleted from the images folder?

OK, I can see where you’re coming from. And it’s less code :-) It does no harm leaving it alone.

only replace it if user chooses to do so.

Oh, right. I figured the TXP thumb should automatically track the default profile. If not, how would this choice be indicated? Given that:

  1. I don’t have any prefs (though I could probably find somewhere to house a single tickbox, it’s a lot of extra code)
  2. Clicking to Create All just goes and does it (no dialog can be offered as the only choices are OK/Cancel… and Cancel always does just that)
  3. Uploading a new image, creating a thumb (in Edit mode) or replacing an existing image automatically fires the creation routine with no further user interaction possible

I could offer a hidden pref I suppose for those that can be bothered to create one: that’s the simplest route for me but not the prettiest solution. The point is, either way it’d be a global on/off switch so has to apply to all actions. Hmmmmm.

Last edited by Bloke (2010-11-10 11:54:45)


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

#25 2010-11-10 12:16:42

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,138
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Assuming user has already created thumbs with one default profile, now changes default profile, then probably user wants to keep thumbs already created, but now create new thumbs for different images. So no need for an indication there. However, if user wants to change existing thumbs, then user must just do this one by one, or all the lot. So still normal use of your plugin?


TXPQ Examples and discussion of Textpattern CMS quality.
Safe Reiki Harmless natural healing.

Offline

#26 2010-11-10 12:31:27

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,152

Re: smd_thumbnail: manage multiple thumbnails of your images

zero wrote:

I’d say don’t delete the txp thumb

Yup. If the images were deleted we didn’t have a fallback when we wanted to turn off smd_thumbnail completely by any (unforeseeable) reason.

And: Yes, <txp:article_image thumbnail="1" /> should keep working, think of people who had uploaded collections of Photoshop-optimized thumbnails.

One mor thing: smd_thumbnail seems to disable the ability to replace a thumbnail with such an optimized one. Can this be re-activated? Perhaps at least temporarily by a switch by whose use I declare that I have completely understood the consequences of such acting and agree with being a Photoshop slave for a lifetime?

And thanks, Stef, for another extra cool, über-useful plugin!


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#27 2010-11-10 12:36:27

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

Re: smd_thumbnail: manage multiple thumbnails of your images

(@zero) Yes… ish.

At present, if you create a bunch of thumbs with the plugin at the designated default size and then alter the default profile, nothing happens to the TXP thumbnails. The only thing you’ll see is the admin-side adjust to use the new size.

In the next version I planned that if you create a bunch of thumbs with the plugin at the designated default size, TXP thumbs are automatically created and overwritten if they already exist. If you subsequently alter the default profile, nothing happens to the TXP thumbnails. Again, the only thing you’ll see is the admin-side adjust to use the new size. The only time the TXP thumbs will be altered is if you create a new (default) thumb, upload a new image or replace an existing image. At that point, the new default is in place so you get the new default sizing.

But I think I’ve had a customary change of heart.

If I could offer prefs to a) create, b) delete TXP thumbs along with the default profile then it adds some sorely missing functionality to TXP: namely the ability to mass-delete thumbnails. As it stands in TXP, you can only delete full-size images using the multi-edit tool. But if you were to tick the ‘yes, delete TXP thumbs too’ option and then deleted the default profile, all TXP thumbs would go as well. This might be a nice feature if you wanted to start afresh or something.

Since the tick boxes would always be available in the control panel you could choose to alter the TXP thumbs with changes to the default profile’s thumbs at will. Thus you could:

  1. Tick them both off: mimics the current plugin behaviour; TXP thumbs are ignored and remain as you have them
  2. Tick Create: allows TXP thumbs to be created when you upload a new image or replace a (default profile) thumb, or use Create All
  3. Tick Delete: allows TXP thumbs to be deleted when you delete an individual (default profile) thumb (in the edit panel) or en masse when deleting a profile

At any point, after you have maybe created the TXP thumbs at a given size, you can tick the checkboxes off and thus leave the TXP thumbs exactly as they are: even as far as not having them created when new images are uploaded (since the checkbox governs the creation and replacement process).

How does that sound?

EDIT: you can also bypass creation/deletion of default thumbnails (regardless of the checkbox setting) by temporarily disabling the default profile. Perhaps if the default profile is disabled I’ll grey out the checkboxes too since they will have no effect.

Last edited by Bloke (2010-11-10 12:41:55)


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

#28 2010-11-10 12:52:12

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,138
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Sounds good! Could you also use the tickboxes alongside every image to choose which image thumbs you wish to delete/create/change?


TXPQ Examples and discussion of Textpattern CMS quality.
Safe Reiki Harmless natural healing.

Offline

#29 2010-11-10 13:00:54

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

Re: smd_thumbnail: manage multiple thumbnails of your images

zero wrote:

Sounds good! Could you also use the tickboxes alongside every image to choose which image thumbs you wish to delete/create/

If you mean the ‘with_selected’ tickboxes alongside each TXP image, sadly they’re not available for plugin use. It’s one area I plan to visit in TXP 5 — opening that up to plugins to add new functionality to the dropdown (not sure if it can be done, but I’m going to try!)

The (new) smd_thumbnail tickboxes will only govern what happens to TXP thumbs when you do something with the default profile. In the meantime, if you wish to turn off creation/deletion/alteration of any smd_thumbnail images, just deactivate that profile while you interact with the image controls.

Does that sort of provide an answer?


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

#30 2010-11-10 13:14:24

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,138
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Yep, great stuff, Stef!


TXPQ Examples and discussion of Textpattern CMS quality.
Safe Reiki Harmless natural healing.

Offline

Board footer

Powered by FluxBB