You are not logged in.
Yes, Stef, that explains it well.
And now that I look deeper into the documentation, I see that you have explained it there too. So, sorry for the above have-not-RTFM questions.
Offline
Hi Stef,
I’m a bit confused. Let me try to explain.
Plugin help says, under the Custom thumbnails section:
- thumbs cannot have dimensions greater than the original image or the upload will be ignored
If by original image you meant the main one, that is, the full built-in managed-by-txp image, then, the above statement is wrong.
My main/original image is 720px (width), and I can upload a 900px (width) image for my “xlarge” smd_thumbnail profile (my “xlarge” profile has been defined to be 900px width)
In other words, the upload hasn’t been ignored.
And I’m pretty happy with that!
I mean, not sure if it was unintended/unplanned/not-in-the-scope-of-a-thumbnail-plugin, but I like/wish/expect that smd_thumbnail can handle/manage/create/allow the “thumbnails” to be larger than the original image.
Let me try to explain:
I’ve created two smd_thumbnail profiles: “medium” (540px width) and “xlarge” (900px width). I expect/planned those two profiles to be the “thumbnails” for a size that is in the midst (720px width).
In other words, the built-in/txp-managed/standard image would be a 720px.
Evidently, 900px > 720px, but I still expect that smd_thumbnail empowers me to have that.
So far, I’m currently happy with the odd (unexpected?) behavior of smd_thumbnail letting me upload larger-than-original-image custom thumbnails, against to what plugin help states.
Certainly, I would also logically expect that smd_thumbnail wouldn’t let me create a larger-than-the-original-image thumbnail, as this would imply some quality loss or distortion (an enlarged-by-software image won’t regain the already loss quality). But, to be fair, even in this case, I would still prefer that smd_thumbnail let me create larger thumbnails of my original images, even if that implies some distortion or quality loss.
I hope you still follow me, because there is something else I’d like to report, and it’s directly related to the last paragraph.
On my short experience with smd_thumbnail during the last day, this was my workflow:
So far, so good.
But then, the unexpected, dissonant thing happened:
I said, “Let’s try the powers of smd_thumbnail to create a 900px image”
width="" attribute) to 900px. I see this as something really confusing, particularly for end-users, that won’t understand why they image seems to be 900px, but then, it’s just 720px.So, Bloke, thanks for reading till here. Now, the quick summary of the issues and my personal wishes/thoughts:
Offline
maniqui
Thanks for the detailed report. Short answer was going to be: not a lot I can do about it because it’s a core feature of the wet_thumb class. At least I didn’t think there was. I knew about the fact you could upload bigger images; the documentation just sucks here so I’ll fix that.
However, now I have my glasses on I can see that it’s possible to override this feature with a simple setting so you might be able to trick it by adding one line to the plugin, around line 261 just before this:
$t->crop = ($crop == '1');
Add:
$t->extrapolate = true;
Then see if that allows you to create images beyond the dimensions of your original. If it works I’ll set it like that by default so you can create images of any size all the time.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern.
Txp Builders – finely-crafted code, design and Txp
Offline
Hi Bloke,
thanks for the reply. Haven’t tested yet the suggested change.
I’ve an idea that may have its merits, if you can code it ;)
What if you plug your plugin to another plugin? Plugtastic! (no, I’m not good at copying your writing style… yet…)
Probably someone already requested it, or even it crossed your mind.
There is the ebl_image_edit plugin that lets you edit (resize, crop, rotate, etc) your TXP images using some cool jQuery/jCrop/Ajax/GD.
Of course, you (or others) may have had this idea and say: “too complicated, it may imply hacking/forking ebl_image_edit, or asking grumpy TheEric…” (note: TheEric, if you are reading this, it’s just a joke!).
But I think there is a workflow to make this two plugins work together like Wonder Twins, without hacking ebl_image_edit.
The workflow:
The idea has some drawbacks:
I’ll stop by now, and only continue if you think this idea may have any merit and may be feasible (and interesting for you to code it).
Offline
Eeek, I just spotted something. When wet changed the image callbacks after RC1 the callbacks are defined ‘backwards’ compared to how they are usually done: they are defined step first, then event so my plugin’s not calling them any more (I assumed event/step like normal).
I’ll issue a fix asap. If your thumbs aren’t being automatically created or deleted when you interact with the plugin that’ll be why, oops, sorry.
maniqui
I’m not sure if I can get the two plugins to co-exist happily but I can certainly add a callback or two to my plugin if others want to be notified of when each thumb is created and do something with them. Likewise, if TheEric or somebody were to add a callback to their plugins I could hoopk into them and create multiple thumbs from each uploaded / cropped image. Maybe. Would need some thought.
Last edited by Bloke (2010-11-21 17:03:35)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern.
Txp Builders – finely-crafted code, design and Txp
Offline
And here’s the fix. In this version:
The smd plugin menagerie — for when you need one more gribble of power from Textpattern.
Txp Builders – finely-crafted code, design and Txp
Offline
@wornout,
not sure what kind of integration with smd_gallery are you looking for, but you can do some basic mashup doing this:
<txp:smd_gallery>
<txp:smd_thumbnail id="{id}" />
</txp:smd_gallery>
One disadvantage of this method is that you can’t fine-control the markup of the <img /> tag, as it’s generated by smd_thumbnail.
Thankfully, regarding that, at least, smd_thumbnail is compatible with the new ihu variable, so the images will be served from the correct location.
One advantage of this method is that you have access to the force_size attribute (hey, Bloke, how does that work? Does it query the file in the filesystem to pick up the “missing” (set to 0) size?), so you can improve the rendering when using this “non-txp-standard” thumbnails.
Then, there is this other method: you could do it even more manually, which adds some flexibility to your markup:
<txp:smd_gallery>
<img src="/images/[SOME_SMD_PROFILE_NAME/{id}{ext}" />
</txp:smd_gallery>
Here, the advantage is having better fine-control over the markup of the <img /> tag.
For example: you could also do <img src="<txp:variable name="static_media_url />/images/[SOME_SMD_PROFILE_NAME/{id}{ext}" /> to fine-control the image URL (static_media_url is just a variable I’ve created, for exactly the same purpose of the new ihu variable).
The disadvantage of this second method is that you can’t access (afaik) to the real dimensions of the thumbnail file, nor even to those defined in the corresponding smd_thumbnail profile, so you can’t replicate the force_size feature of smd_thumbnail.
If some kind of integration could be done between smd_gallery and smd_thumbnail, I think it would be that one: if possible, to let smd_gallery “know” the real size of thumbnail, and create the corresponding {replacement_variables}.
Offline
maniqui
All good stuff, thanks for fielding this one.
One advantage of this method is that you have access to the
force_sizeattribute …how does that work?
You are right, it queries the file system using getimagesize().
you can’t access (afaik) to the real dimensions of the thumbnail file
Correct. I guess I could (should?) offer either usual {replacement} vars or a <txp:smd_thumb_info /> tag so you can use smd_thumbnail as a container if you wish and build your own thumbnails. Will look into that at some point, thanks for the idea both of you.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern.
Txp Builders – finely-crafted code, design and Txp
Offline
Stef, is it possible to allow “create all” for checked images only ?
To create thumbnails for just uploaded images only ?
Offline