Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2010-04-18 13:53:15
- dandul
- Member
- From: Brisbane, Australia
- Registered: 2010-01-31
- Posts: 33
can't access new image thumbnails through SMD_gallery
Hi, I’m having a problem accessing image thumbnails through SMD_gallery.
I’ve been using SMD_gallery plugin with shadowbox.js (for an item called “fleecePic”). There’s an image-thumbnail of a fleece, and when you click on it the full size image appears. It’s been working fine.
eg: http://www.codd.info/shi100/females-for-sale/shikota-amazing-grace
(go to the bottom of the page and click on the pic of white wool)@
But after downloading the site onto my laptop, now the thumbnails of any new images don’t appear. All the old images still work, but no new ones.
old image: http://www.codd.info/shi400/females-for-sale/celtic-spirit
new image: http://www.codd.info/shi400/females-for-sale/catcher
Bizarrely, the thumbnails appear fine with UPM_article_image. If I call the recently-uploaded thumbnail directly like this:
<txp:thumbnail id='<txp:custom_field name="fleecePicNo" />' />
the recently-uploaded thumbnail appears.
But in SMD_gallery none of the recently uploaded files appear when I run this form
<txp:if_custom_field name="fleecePicNo">
<ul class="thumbs">
<li><txp:smd_gallery id='<txp:custom_field name="fleecePicNo" />' form="235_fleecePic_gallery" /><br />
Click for detail</a></li>
</ul>
</txp:if_custom_field>
Form: 235_fleecePic_gallery:
<a href="{url}" title="{title}" rel="shadowbox[gallery2]">
<img class="img" src="<txp:site_url/>images/{thumbdef}" alt="{alt}" />
</a>
AND – this may just be a coincidence, but at the same time I started getting an error message when I upload image files.
Warning: getimagesize() [function.getimagesize]: Filename cannot be empty in /Applications/MAMP/htdocs/CODD_INFO/shi400/textpattern/include/txp_image.php on line 843
This is so weird – I presume the problem is in the recently uploaded image thumbnails, but why is only SMD gallery affected?
Does anyone have any ideas?
Stop wishing things were different to the way they are. Accept it, deal with it, move on.
Offline
Re: can't access new image thumbnails through SMD_gallery
Weird indeed. It’s almost like the new images aren’t making it to the /images
directory. Or they can’t be read back for whatever reason. Perhaps upm_image does some trickery to get at the thumbs. Or perhaps (looking at it from the other angle) smd_gallery is dumb :-)
I wonder if {thumbdef)
is perhaps not being created correctly or your laptop is struggling to build the URL due to directory permissions. Or perhaps (a long shot) your prefs settings need altering to take account of the new environment? (you’re running TXP 4.2.0, right?)
Either way, try this in your 235_fleecePic_gallery
form:
<a href="{url}" title="{title}" rel="shadowbox[gallery2]"> <txp:thumbnail id="{id}" class="img" /> </a>
That references the image by what is stored in the database (which I suspect is what upm_image does) instead of trying to create the img src
as a path.
If that fails, try putting smd_gallery in debug="2"
or higher mode and it might give you some clues in the replacement arrays as to where it’s going sideways. If you figure it out then it may well be a bug so I’d appreciate your findings, thanks.
Last edited by Bloke (2010-04-18 18:33:49)
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 2010-04-19 00:57:59
- dandul
- Member
- From: Brisbane, Australia
- Registered: 2010-01-31
- Posts: 33
Re: can't access new image thumbnails through SMD_gallery
Thanks bloke, tried your new code – no luck. The debug reported NO ‘replacements’ info for the dodgy images AT ALL.
At this point I decided discretion was the better part of staying sane so I tried playing with wet_for_each_image (as per you reccomendation in the help file) and then… stumbled across <txp:thumbnail /> which had a “link atribute” etc etc
So now the code is JUST this:
<txp:if_custom_field name="fleecePicNo">
<ul class="thumbs">
<li>
click to see large version<br/>
<txp:thumbnail id='<txp:custom_field name="fleecePicNo"/>' link="1" link_rel="shadowbox[gallery2]" />
</li>
</ul>
</txp:if_custom_field>
Thanks for the reply, it got me back looking. So the code (for the moment) is a very simple TXP tag. Marvellous!
Cheers!
Stop wishing things were different to the way they are. Accept it, deal with it, move on.
Offline