Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#271 2014-09-26 12:19:30

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,786
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

jpdupont wrote #284224:

:-))) Very fast reply ! Big thanks from Belgium, Stef !

You’re welcome.

BTW, You are currently subscribed to this topic don’t work any more for me since the upgrade of the forum.

Other people have mentioned similar things. But I don’t know if it’s specific to this forum upgrade. Destry has been complaining about flaky subscription notices for time immemorial, so there must be something else going on which I don’t have the knowledge to comprehend. Maybe it is a language thing. Would love to find out why.


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

#272 2014-09-26 12:20:02

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,430

Re: smd_thumbnail: manage multiple thumbnails of your images

jpdupont wrote #284224:

BTW, You are currently subscribed to this topic don’t work any more for me since the upgrade of the forum.
I try many e-mails accounts, my servers, gmail, …

The same for me and my post did not help.

Offline

#273 2014-10-01 11:16:33

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

Re: smd_thumbnail: manage multiple thumbnails of your images

Probably a dumb question, but nevertheless …

<txp:smd_thumbnail id="10" type="banner" /> 

renders an image … :)

<txp:smd_thumbnail type="banner" />

renders nothing … because the tag is missing an ID ( or ‘name’) … right?

What can I do to let the plugin render ALL images (thumbnails) with the type="banner" … !?

Last edited by RedFox (2014-10-01 11:19:40)

Offline

#274 2014-10-01 11:42:58

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

RedFox wrote #284409:

Probably a dumb question, but nevertheless …

<txp:smd_thumbnail id="10" type="banner" />...

renders an image … :)

<txp:smd_thumbnail type="banner" />...

renders nothing … because the tag is missing an ID ( or ‘name’) … right?

What can I do to let the plugin render ALL images (thumbnails) with the type="banner" … !?

Wrap it in <txp:images> perhaps? Not in a position to test that right now.

Offline

#275 2014-10-06 10:05:06

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

Re: smd_thumbnail: manage multiple thumbnails of your images

joebaich wrote #284411:

Wrap it in <txp:images> perhaps? Not in a position to test that right now.

Yes, it was a dump question >

<div class="banner">
<txp:adi_if_mobile>
<txp:images limit="1" sort="rand()" form="banner">
<txp:smd_thumbnail type="mobile" />
</txp:images>
<txp:else />
<txp:images category="banner" limit="1" sort="rand()" form="banner" />
</txp:adi_if_mobile>
</div>

Nevertheless … there is still a very weird problem:

<txp:smd_thumbnail type="mobile" /> renders an error: <txp:smd_thumbnail type=“mobile” /> -> Textpattern Notice: Unknown image while parsing form “None” on page “default” … but <txp:smd_thumbnail type="main" /> renders an image … !?

I’ve checked all I know that can be checked … prefs, chmod, /images, reinstall, etc … I am baffled.

I’m using latest Txp (4.5.7) with smd_thumbnail 0.31 …

Last edited by RedFox (2014-10-06 10:09:50)

Offline

#276 2014-10-06 19:51:20

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,786
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

RedFox wrote #284565:

I’ve checked all I know that can be checked … prefs, chmod, /images, reinstall, etc … I am baffled.

Very odd. It displays fine for me on my test setup.

Couple of straws to clutch at, though it sounds like you’ve tried all these:

  • Remove the form attribute from the first <txp:images> tag. Txp should ignore it since there’s a container specified, but for your sanity’s sake in six-months’ time…
  • Check and double-check that your mobile folder contains every image id. If main works and mobile doesn’t, it may simply be a missing image or one particular picture that it’s struggling to read. What happens if you use the plugin’s Tools to recreate images?
  • Check the capitalisation of the folder. The contents of the plugin’s type attribute is case sensitive (under *nix at least) because it deals with file paths.
  • Does it work with one particular image ID/name? i.e. instead of using rand(), pick one you know exists and try to display it using the id attribute. If that works, it may simply be that rand() is picking ones that don’t exist (or that exist in the database but not in the file system for some reason).
  • Compare in micro-detail the main and mobile folders to see if there’s any minuscule differences in the way they are set up. Although it’s a very long shot, if you can look at hidden permissions/sticky bit, do so. Also check for things like rogue spaces in the folder or profile name. mobile will not be found, for example.

Past that I’m equally stumped. If you’ve tried all of the above and it’s not playing ball, feel free to drop me a login if the project is web-accessible and I’ll see if I can help you figure it out.


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

#277 2014-10-06 22:38:27

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

Re: smd_thumbnail: manage multiple thumbnails of your images

Bloke wrote #284575:

Past that I’m equally stumped. If you’ve tried all of the above and it’s not playing ball, feel free to drop me a login if the project is web-accessible and I’ll see if I can help you figure it out.

Your turn … I’ve send you an email. Don’t look at the mess …

Last edited by RedFox (2014-10-06 22:40:37)

Offline

#278 2014-10-07 08:23:52

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,786
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

RedFox wrote #284576:

Your turn … I’ve send you an email. Don’t look at the mess …

What mess? Looks fine to me!

Thanks for the login. I traced the issue to a combination of the following:

  1. Though the unnecessary form attribute on the <txp:images> tag wasn’t a problem as such, it seemed to be confusing something, because when I took it out it began to play better. Dunno why.
  2. Your mobile folder only had two images in it (ids #6 and #8). You could see this when you edited an image. You have five profiles set up but only four thumbnail images were showing on the Image Edit panel for most images. When I used smd_thumbnail’s Tools/Prefs tool to recreate all thumbnails, the mobile folder was populated with all the images.

The error’s now gone. Hope that helps.


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

#279 2014-10-07 10:32:56

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

Re: smd_thumbnail: manage multiple thumbnails of your images

Bloke wrote #284580:

Your mobile folder only had two images in it (ids #6 and #8). You could see this when you edited an image. You have five profiles set up but only four thumbnail images were showing on the Image Edit panel for most images. When I used smd_thumbnail’s Tools/Prefs tool to recreate all thumbnails, the mobile folder was populated with all the images.

The error’s now gone. Hope that helps.

Sure, it helps a lot … thanks Stef. But … to understand smd_thumbnail correctly: all folders (profiles) have to contain all and the same thumbnails (IDs)? And must all individual pages (images) have all the thumbnails rendered? Or … when is smd_thumbnail in trouble … !?

Offline

#280 2014-10-07 11:07:16

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,786
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

RedFox wrote #284581:

all folders (profiles) have to contain all and the same thumbnails (IDs)?

Yes. Each profile is a sub-folder in your images folder. For every database image that you upload/create, smd_thumbnail expects one file per profile to exist with the ID of the original image.

It creates thumbs for all active profiles when you upload images and, for the most part, this works fine. Depending on your smd_thumbnail prefs it’ll also try and keep things in sync when you make changes.

If you disable a profile and upload images, then later re-enable it, you’ll find some ‘holes’ in your thumbnail arsenal. That’s what the Tools/Prefs area is for: to allow you to re-synchronise everything.

smd_thumbnail will only try to access files for profiles which you mention in your <txp:smd_thumbnail> tag. So if you have holes anywhere, they only show up if you try and access that particular image. In your case, the random selection was falling foul of the fact you only had two images in that profile so in the majority of cases, it was failing to find one for the ID it had randomly chosen.

Here’s a good tip (which I keep forgetting to document properly and make clear in the alert box that pops up) : if you have a lot of profiles, you can cut down the amount of unnecessary work the plugin has to do during a resync by temporarily disabling any profiles you know hold a ‘complete’ set of IDs. The mass-resync then only affects the group of images you have chosen and only tries to recreate those files in any active profiles. With many profiles, the amount of disk activity is slashed and your resync completes in a fraction of the time.

Does that answer your question or do I need to give some more detail?


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

Board footer

Powered by FluxBB