Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#205 2013-03-08 15:54:52

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

Re: smd_thumbnail: manage multiple thumbnails of your images

RedFox wrote:

Are there people who have done this before? I need some help here.

I’ve not done this but late autumn had a look at the code of retina.js (beautified) to see whether I thought I could adapt this should I need to.

The essential spot in retina.js will be

n+"@2x."+r

And as you say, it needs to look in a different directory, plus we don’t have the (at)2x name extension. So, try to replace the above “code quote” with something like

"YOUR-RETINA-FOLDER-NAME/"+n+"."+r

and post your results. Edit: Note that I altered the replacement code.

(Whoa, when it comes to posting @ in code I rarely can retain an inclination for Textile.)

Last edited by uli (2013-03-08 16:10:07)


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

Offline

#206 2013-03-12 14:41:40

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

Re: smd_thumbnail: manage multiple thumbnails of your images

Any tangible results, Joop?

Maybe you should add a ../ in front of YOUR-RETINA-FOLDER-NAME, in addition to my proposal, as you seem to have the sets of images in neighboured folders (main/main2).


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

Offline

#207 2013-03-12 15:09:02

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

uli wrote:

Maybe you should add a ../ in front of YOUR-RETINA-FOLDER-NAME, in addition to my proposal, as you seem to have the sets of images in neighboured folders (main/main2).

It uses JavaScript to check whether the server responds with correct content-type to the image path. The paths, like any other link on a page are relative to the document location opposed to the working directory (the images). The path can be relative either to the page (like your normal image URLs), or if possible ideally absolute paths (from root) or full URLs.

The ../ component would work if images in question are on a page (requested from) at the first level sub-directory and the images directory is on the root, and the path isn’t an absolute.

As URLs go, you really shouldn’t use .. or . components in middle of them, only at the beginning. If you need to travel up, you will have to parse the URL and format a new one, or replace it.

If you want to alter the path retina.js looks into, you should/could modify the RetinaImagePath function in the original source code. It uses some very basic regular expressions, which you could alter to inject a new component to the URL or change the parent directory component’s name.

You can find the source repository on GitHub. The project doesn’t seem to use any crazy build scripts, so you should be able to compress/compile it with any tool of your choice after you have done edits.

Last edited by Gocom (2013-03-12 15:20:54)

Offline

#208 2013-03-12 16:23:05

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: smd_thumbnail: manage multiple thumbnails of your images

I read the doc and the forum but I don’t find it …

Stef, is it possible to avoid the creation of thumbnails if the image is smaller than the thumbnail expected ?

Offline

#209 2013-03-12 16:23:05

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

Re: smd_thumbnail: manage multiple thumbnails of your images

That’s revealing, Jukka, thanks.

Joop, I’m afraid I’ve to quit accompanying you here, I was refering to a different version of the script: the download (which is the older one), not the Git version, and there are significant differences between the two. I’d dare trying that locally but can’t advise you, sorry.


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

Offline

#210 2013-03-12 20:16:45

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

Re: smd_thumbnail: manage multiple thumbnails of your images

It’s okay, Uli … I’m not in a hurry!

Offline

#211 2013-04-25 22:42:55

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Hey Stef,

For the first time ever, one of your plugins isn’t working for me! Usually flawless.

Running 4.1.1, when I click on an image to edit it, the smd_thumb options are not visible (there is just a single grey line). I assume this is where the custom options would be.

Any ideas?

Hope all is well :¬)

Offline

#212 2013-04-25 23:15:44

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

Re: smd_thumbnail: manage multiple thumbnails of your images

rossharvey wrote:

when I click on an image to edit it, the smd_thumb options are not visible

Which version of smd_thumbnail are you using? The beta v0.30 is for 4.5+ while the “official” version 0.22 is for 4.4.1.

I use the term ‘beta’ lightly as it’s only because I’ve been too busy/lazy to officially release all my plugins for 4.5 that they’re in the beta folder. Most of them work fine on 4.5 now. Just a few stragglers like smd_tags that are letting the side down.

Last edited by Bloke (2013-04-25 23:16:31)


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

#213 2013-04-25 23:38:16

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

I was using 0.22 buddy, being on 4.4.1.

Edit: when enabled, the standard/existing TXP thumbs disappear from the image list (although I think this is expected), replaced with ‘No’, and when viewing an individual image, there is nothing between Replace Image and Image Name, except two grey separator lines.

Last edited by rossharvey (2013-04-25 23:40:45)

Offline

#214 2013-04-25 23:57:02

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

Re: smd_thumbnail: manage multiple thumbnails of your images

rossharvey wrote:

when enabled, the standard/existing TXP thumbs disappear from the image list (although I think this is expected)

That is expected. Depending on the smd_thumbnail prefs, they will either be kept in sync behind the scenes as you upload your smd_thumb thumbnails, or they’ll stay as they were before the plugin was enabled.

replaced with ‘No’

That means you don’t (yet) have any smd_thumbnail thumbs. Perfectly normal when using the plugin first time or if you don’t have a default thumbnail profile set.

when viewing an individual image, there is nothing between Replace Image and Image Name, except two grey separator lines.

As long as the plugin installed ok, that only happens if you have not set up any thumbnail profiles. Can you please check if the smd_thumbnail table exists in your database and that you have at least one (active) profile set up in it? Drop down the Thumbnail profiles twisty on the Image list screen and make sure the values in the profile(s) you have set up match with the ones in the database table. Let me know if there are any discrepancies as it might give me a clue what’s going on.


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

#215 2013-04-26 00:03:57

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Ah, it seems I hadn’t saved the profile correctly – thanks for your help (as always)!

Glad to see you working in the TXP core btw :¬)

Offline

#216 2013-05-15 17:50:29

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Hi Stef.

I have a thumbnail profile named Grid, and I’ve created the necessary thumbs for the article images. I get this error when I try and call the plugin:

Tag error: <txp:smd_thumbnail type="Grid"/> -> Textpattern Notice: Unknown image. on line 1245

Trace:

	[article 107]
	[Form: list_grid]
	<txp:smd_thumbnail type="Grid"/>
		Tag error:  <txp:smd_thumbnail type="Grid"/> -> Textpattern Notice: Unknown image.  on line 1245
	<txp:permlink />
	<txp:title/>

The portfolio page calls a form:

<txp:article_custom section='weddings,slideshow' category="grid" sort="custom_9" form='list_grid' />

The form, list_grid is:

                    <li class="linkwrapper">
                        <txp:smd_thumbnail type="Grid"/>
                        <a href="<txp:permlink />" title="<txp:title/>" class="description"><txp:title/></a>
                    </li>

Am I missing something obvious?

TXP 4.4.1, plugin version 0.22.

Last edited by rossharvey (2013-05-15 18:56:49)

Offline

Board footer

Powered by FluxBB