Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-09-24 04:31:53

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 259
Website

TXP 4.2.0 and Textile image size problem

I’m busy finalising a website before it goes live, and have encountered a strange problem – Textile displays the image, but gets the sizes wrong. But only on a particular stretch of pages, and only since I upgraded from 4.06 to 4.2.0

For example, if you visit the Kenneth Frampton article (you’ll find it just below the fold), you’ll notice that the first image is rendered with a width and height of 325px. The image’s actual size is 240×260px, verified in the MySQL database.

I’m specifying the image in Textile like so:

...covering the first four decades of his practice. !../images/37.jpg(Harry Seidler - Four Decades of Architecture)! This I agreed to do, providing a local architectural writer...

All the other images on the same url suffer the same problems.

I’m stumped. Anyone have any suggestions?

Thanks

Offline

#2 2009-09-24 04:46:24

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,076
Website Mastodon

Re: TXP 4.2.0 and Textile image size problem

try adding it in this format <img src=“http://all-sorts.biz/hsa/images/37.jpg” width=“240” height=“260” alt=“imagel” title=“image” /> .. and see if this renders it right


…. texted postive

Offline

#3 2009-09-24 05:55:39

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: TXP 4.2.0 and Textile image size problem

Please post the relevant IMG element code as visible from HTML view in the write tab. Also, try absolute image URIs to see if that matters, like so !http://example.com/images/42.png!

Offline

#4 2009-09-24 10:16:17

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 259
Website

Re: TXP 4.2.0 and Textile image size problem

Thanks, Giovanni & Robert

Doh! Dunno why I didn’t think of that myself: using an absolutely referenced image does the trick.

Best
Gary

Offline

#5 2009-09-24 10:41:48

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: TXP 4.2.0 and Textile image size problem

Random notes:

Testing this, I find that !../images/37.jpg! results in src="./images/37.jpg" in the HTML. Strange…

Textile doesn’t look in the DB to find the image size. For relative URLs it attempts getimagesize() on the actual file. For absolute URLs, nothing.

Root relative (i.e., !/images/37.jpg!) works. So, of course, does <txp:image id="37" /> (in which case height and width, as well as title and alt attributes, will be pulled from the database).


Code is topiary

Offline

#6 2009-09-24 11:04:51

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 259
Website

Re: TXP 4.2.0 and Textile image size problem

jsoo wrote:

So, of course, does @<txp:image id=“37” />

I tried that earlier, but the parser tripped up – it stops parsing the remaining articles altogether i.e. the Frampton article ends up as the last one on the page…

update
I’ve noticed that the final @</body></html> are missing on the page as well – something is fishy with my set-up…

Hmmph; it can wait for the morning. Code is easier to understand with coffee ;-)

Last edited by giz (2009-09-24 11:42:19)

Offline

#7 2009-09-24 11:41:37

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: TXP 4.2.0 and Textile image size problem

giz wrote:

I tried that earlier, but the parser tripped up – it stops parsing the remaining articles altogether i.e. the Frampton article ends up as the last one on the page…

Suggestive of a Txp tag error or malformed tag somewhere on the page.


Code is topiary

Offline

#8 2009-09-24 11:44:15

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 259
Website

Re: TXP 4.2.0 and Textile image size problem

Hah! You beat me to the punch, jsoo. Certainly looks like a malformed tag.

Offline

#9 2009-09-24 12:29:51

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,012
Website GitHub Mastodon Twitter

Re: TXP 4.2.0 and Textile image size problem

Hi Gary, Also remember that later version txps are very unforgiving to extra spaces or unclosed tags.

A tag trace detects the major errors … normally.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#10 2009-09-24 22:33:32

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 259
Website

Re: TXP 4.2.0 and Textile image size problem

colak wrote:

Hi Gary, Also remember that later version txps are very unforgiving to extra spaces or unclosed tags.
A tag trace detects the major errors … normally.

Hi Yiannis

The tag-trace shows nothing untoward. I’m gonna <txp:hide>remove</txp:hide> portions of the code until things correct themselves (fresh coffee clutched in hand).

Last edited by giz (2009-09-24 22:33:49)

Offline

#11 2009-09-24 22:53:58

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 259
Website

Re: TXP 4.2.0 and Textile image size problem

I found the culprit – an instance of zem_contact within <txp:hide> tags…

I have closing body and html tags again. krusty.​w3.​org will be pleased.

Update
All appears normal but I still end up <txp:image id="37" /> causing subsequent articles on the page to disappear…

The tag trace shows:

blah-blah
[ ~~~ secondpass ~~~ ]
<txp:image id="37" />
[SQL (8.4877014160156E-5): select * from hsa_txp_image as txp_image where id = 37 limit 1]

and then ends.

For the moment I’ll use absolute image urls in Textile.

Last edited by giz (2009-09-24 23:10:03)

Offline

Board footer

Powered by FluxBB