Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-09-01 10:46:26

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Thumbnail height/width

Txp now (as of v 4.2.0) stores thumbnail height and width, but older images are left with these fields empty. Anyone planning a plugin to fill in these fields for existing, pre-4.2.0, images? I might have a go at this, but certainly don’t want to start if it’s already in the works.


Code is topiary

Offline

#2 2009-09-01 10:59:38

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: Thumbnail height/width

jsoo wrote:

Anyone planning a plugin to fill in these fields for existing, pre-4.2.0, images?

No plans in this department. I was just going to allow smd_gallery to read them if they were in the DB and fall back on user-supplied thumb sizes otherwise.

As a side-note, having a plugin that could whip through your DB and set them all to specified dimensions (perhaps optionally on a list of categories basis?) would be a mighty handy plugin when you refactor your site and want to alter your thumb sizes en masse. Though I guess that’d probably be in the realms of EBL_image_edit (or equivalent) as it’d have to recrop the actual thumbnail itself if the dimensions changed drastically.


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

#3 2009-09-01 11:47:18

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Thumbnail height/width

Bloke wrote:

As a side-note, having a plugin that could whip through your DB and set them all to specified dimensions (perhaps optionally on a list of categories basis?) would be a mighty handy plugin when you refactor your site and want to alter your thumb sizes en masse.

Well, before 4.2.0 you could apparently do as I described here

It would be rather nifty, if one could select multiple images in the main listing and choose With selected: Rebuild thumbnails. So that when you choose that option, it would display width- & height input fields and a checkbox to crop square.

By the way, why are thumb dimensions now stored in the db?

Offline

#4 2009-09-01 11:51:17

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Thumbnail height/width

Bloke wrote:

No plans in this department.

Why isn’t this done during the upgrade to 4.2?

Offline

#5 2009-09-01 11:58:50

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: Thumbnail height/width

masa wrote

why are thumb dimensions now stored in the db?

It was conspicuously missing before and means plugin authors don’t necessarily have to rely on PHP calls to ascertain image dimensions directly from the image itself.

ruud wrote:

Why isn’t this done during the upgrade to 4.2?

*shrug* ‘cos we wanted to give jsoo an excuse to write a(nother) kick-ass plugin? :-p

Last edited by Bloke (2009-09-01 11:59:14)


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

#6 2009-09-01 12:07:04

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Thumbnail height/width

Bloke wrote:

It was conspicuously missing before and means plugin authors don’t necessarily have to rely on PHP calls to ascertain image dimensions directly from the image itself.

I see.

Anyway, I did a quick mockup of what I was describing before:

Batch Thumbnail Creation

Would that be difficult to implement?

Offline

#7 2009-09-01 12:09:46

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Thumbnail height/width

ruud wrote:

Why isn’t this done during the upgrade to 4.2?

Because I assumed various issues with that approach (running into memory limitations, run time aborts etc.) with high-volume sites. Not a thing I wanted to resolve while a site upgrade was underway.

Offline

#8 2009-09-01 12:18:31

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Thumbnail height/width

Bloke wrote:

having a plugin that could whip through your DB and set them all to specified dimensions (perhaps optionally on a list of categories basis?) would be a mighty handy plugin when you refactor your site and want to alter your thumb sizes en masse. Though I guess that’d probably be in the realms of EBL_image_edit (or equivalent) as it’d have to recrop the actual thumbnail itself if the dimensions changed drastically.

Do I understand correctly that you mean set height and width to values that do not correspond to the actual image file? I’d find that one tough to swallow. I prefer to set image display sizes using relative units (e.g. ems) anyway.


Code is topiary

Offline

#9 2009-09-01 12:19:45

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: Thumbnail height/width

masa wrote:

Would that be difficult to implement?

Thanks for the mockup. Off the top of my head, not sure.

One of the things I’d like to look at (longer term, it’s low priority at the moment) is the possibility of allowing plugin authors to add things to the with-selected dropdowns and design their own actions. It would then be eas[y|ier] for a talented plugin author to provide this functionality instead of limiting it to a core feature that might not do everything you dream it could.

But I don’t even know if that’s possible yet so don’t get your hopes up! It was a random thought that came out of a discussion I had with net-carver and is on the “To investigate one day” pile…


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

#10 2009-09-01 12:20:45

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: Thumbnail height/width

jsoo wrote:

Do I understand correctly that you mean set height and width to values that do not correspond to the actual image file?

Yeah, I realised after I posted that’s out of scope here, sorry.


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

#11 2009-09-03 20:07:24

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Thumbnail height/width

Plugin now available.


Code is topiary

Offline

Board footer

Powered by FluxBB