Textpattern Forum

You are not logged in. Register | Login | Help

#111 2011-04-10 19:33:54

Pablo Apiolazza
Member
From: Trieste, Italy
Registered: 2011-03-03
Posts: 19
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

jstubbs wrote:

Pablo, you need to use the new image tags recently added to TXP. If you look at this TXP Tip – specifically the _ portfolio_gallery_ code block you will see how to replace upm_image with native TXP tags.

Hi! I think I’m too noob to understand tha approach. I managed to retrieve the proper image with smd gallery, but dunno how to turn it into an URL

This is the current markup:

meta property=“og:image” content=’<txp:image_url /><txp:smd_gallery id=?article_image><txp:smd_thumbnail type=“Facebook” id=”{id}” /></txp:smd_gallery></txp:image_url />’/>

Offline

#112 2011-04-27 21:48:30

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

Re: smd_thumbnail: manage multiple thumbnails of your images

I have an error (notice) on generating thumbnails when the user is not an admin.

Notice: Undefined index: smd_thumb_profile_tool_heading in /home/www/f4ea72194541944893ef2c9782deb5b5/web/bibliotheque/textpattern/lib/txplib_misc.php(653) : eval()'d code on line 1294

How allow non admin to see the prefs of the thumbnail screen (image tab) ?

Last edited by jpdupont (2011-04-28 06:00:51)

Offline

#113 2011-04-28 06:08:57

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

Re: smd_thumbnail: manage multiple thumbnails of your images

I create the missing smd_thumb_profile_tool_heading entry in the language part of the plugin code and all is ok.

Now, how allow non admin to see the thumbs prefs ?

Offline

#114 2011-05-12 19:13:40

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,982
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Minor update to v0.21. No new user functionality, just a new function smd_thumb_get_profiles() that allows other plugins to interrogate smd_thumbnail to find the active profiles *mysterious music plays*

jpdupont

No idea what happened with your version: that gTxt string is definitely in the code. Weird glitch.

As far as allowing non-admins to see the prefs, the idea is that they don’t. Only admins should set the prefs because they’re global, but if you have a different requirement (e.g. your admin users are actually managing editors or something) then you’ll have to edit the plugin code for now. Alter line 6 and list the priv levels you want to have access to the prefs, .e.g.:

$smd_thumb_prevs = array('1, 2'); // Privs for prefs

Would allow publishers and managing editors to see them. Hope that helps.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#115 2011-05-13 11:31:19

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

Re: smd_thumbnail: manage multiple thumbnails of your images

Thanks Stef !

Offline

#116 2011-06-10 14:12:15

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

Re: smd_thumbnail: manage multiple thumbnails of your images

Stef, when I use your code $smd_thumb_prevs = array('1, 2'); // Privs for prefs, the tab is hidden. I’m logged as admin.

Offline

#117 2011-06-10 15:17:46

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,982
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

jpdupont wrote:

Stef, when I use your code $smd_thumb_prevs = array('1, 2'); // Privs for prefs, the tab is hidden. I’m logged as admin.

Ooops, my bad:

$smd_thumb_prevs = array('1', '2');

(note the extra single quotes). Sorry.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#118 2011-06-23 20:10:06

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 542
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Hey Stef! (long time)
Thanks for another super plugin :)

I do have a question please:

Because of this plugin replace/hides the regular TXP thumbnail system,
it’s can’t work with ‘ebl_image_edit’.
(Only if you make your magic by editing ‘ebl_image_edit’ to somehow work with the SMD thumb system, which I have no idea how)

Now since I must let the clients to be able to manually crop the thumbnail image like in ‘ebl_image_edit’,
then I will like your plugin to play as an extra system and not interfere the original one, this by creating only extra thumbnails and also not from the original-image but from the regular-thumbnail (which I can control with ‘ebl_image_edit’), now is it possible and simple enough to do please?

The reason I want it to create the extra thumbnails from the regular-system thumbnail it’s to get a much better result.
For example:
If I upload a vertical image of a person and then I’m using ‘ebl_image_edit’ to crop the head, and then I’m using your plugin to create smaller versions of it then I will end with a much better result then I was using only your plugin and by cropping the original image I was end with the chest of the person instead of the head.

(Of course it was the most perfect if there was a feature to manually crop each of the thumbnails using jCrop or other jQuery plugin, but I believe it will require a magic-wand, or just a lot of work isn’t it?)

Offline

#119 2011-06-23 20:35:37

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,982
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

THE BLUE DRAGON wrote:

creating only extra thumbnails and also not from the original-image but from the regular-thumbnail

Hmmm, if TheEric added a callback to his plugin on completion of the crop function then I could probably get smd_thumbnail to hook into that and create the thumbs for the edited image right then. Sadly, Eric has stated that he will never interface with any other plugins so I guess that’s out of the question.

However, I might be able to add a preference to my plugin that allows you to create the smd_thumb from a txp thumb, instead of from the full size image. I’m not sure if it’ll let me — it’s been a long time since I looked at the code — and it won’t be automatic. That is, you’ll have to go and batch process the ones you want to alter after you’ve cropped them, which is not ideal. Essentially what will happen is this:

  1. the plugin will automatically create thumbs on upload (from the original image)
  2. you crop your thumbs in ebl_image_edit
  3. you visit the Tools area of smd_thumbnail, choose the images you want to affect and it’ll go and recreate them from the thumbnails

Let me take a look and see if any of that’s possible.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#120 2011-06-23 21:06:23

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 2,989
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Just for helping (or disturbing) your thoughts, here is my proto-idea of how to make smd_thumbnail and ebl-image-edit play nice together

Of course, saying it is easier than coding it :P

Being that TheEric stated what Bloke already linked, I think there are two possible paths:

  • the “pure” smd_thumbnail approach
  • the “pure” ebl-image-edit hack/mod approach

The “pure” smd_thumbnail approach would work by “fetching” the latest txp_thumb (aka regular thumb, original thumb) thumbnail created/cropped/resized by ebl-image-edit and storing it in the corresponding profile folder (selected on advance via some dropdown select).

The “pure” ebl-image-edit hack/mod approach would work by hacking that plugin to present the user with a dropdown select (on the “Crop” tab/fieldset), listing all the folders inside the /images/ folder. Or, in other words, to present all the folders created by smd_thumbnail, which are the folders where smd_thumbnail stores the thumbs.
So, this hypothetical hack would check for existing subfolders on /images/ and present them in a dropdown. The user would pick the folder, create the thumb, and it will get stored on the selected folder.
ebl-image-edit probably already has some re-usable code for this latter step, as that is what the plugin does when user hits the “Backup” button (i.e. it stores a copy of the image on the /images/backup/ folder).

If what my brain imagined is somewhat accurate/realistic, non of this “pure” approaches would need to “know” if the other plugin is installed or not.
So, to create a new thumbnail from the regular txp thumb (created using ebl-image-edit), it shouldn’t care for smd_thumbnail to “know” if ebl-image-edit is installed or not.
And, similarly, for a hacked ebl-image-edit that would check existing subfolders in /images/ folder, present them via a dropdown select, and saving the new cropped/resized thumb on the selected folder, it doesn’t need to “know” if smd_thumbnail is installed or not.

Eh, what did I say before? Saying it is easier than coding it :P


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB