Layout Runtine error
Feb. 11th, 2005 @ 05:00 pm
I've written my own layout for Scrapbook, and I've run into a problem - well more like a problem has arisen that didn't when I first wrote the layout.
On my Picture pages (The ones that come from a Gallery page), I used to scale my images to a maximum of 500x500 so that it didn't stretch the page out. I used this code:
var Image pageThumb = $.picture->get_image(500,500); # get a scaled version of the image
$pageThumb->print(); # print the scaled image
# $.picture.fullimage->print(); # print the unscaled image
The pages will not load at all now. What I find extremely odd is that the page will only load if the get_image method is called with paramters 100,100 - anything else and the page never loads, no error messages at all.
I am so confused why this would be happening now. Any ideas anyone?
There is actually a list of allowed dimensions. Here they are:
widths: 50 100 150 320 640 800 1024 1280 1600
heights: 0 50 100 150 240 320 480 600 640 768 960 1200
The w/h you pass to $.picture->get_image is valid if the width and height are valid with respect to the lists above, and aspect ratio is maintained.
This is done to get maximum reuse of scaled images and to limit the amount of image data a user can generate in the form of scaled images.
Does this help?
Thank you. That does help. Once I used one of the sets of values from the list, it worked beautifully.
Was this a recent addition to the specifications for that function? Because I used to use 700x700 and it worked for a while, but no more. I also think that the method description on the documentation page should be altered to reflect the subset of options for the function's parameters.
It was a bug that the stipulation wasn't properly enforced. Now if you choose wrong dimensions you should get a 404 not found.
|Date:||March 8th, 2005 12:52 am (UTC)|| |
where did you write your own layout? i can only find ways to customise the layouts already given, and nowhere to create my own...
|Date:||March 8th, 2005 06:08 am (UTC)|| |
huh. wow. i don't think i'm smart enough to understand how to play with any of that. *g* oh well. thanx anyway :)
Yeah it's a bit daunting at first. It took me about a week to read through a lot of it, understand it, code up my layout, and work out the kinks :)
Any chance someone else could use your code?
I have two layouts for Scrapbook that match my LJ layouts Smooth Sailing and Bordered Boxes, although they're both very heavily customised to match my LJ layout, and contain a lot of references to me.
What would you want to use the code for? If you did take it you'd have to go through it and change some me-specific references.
Since I like BB so well, I think it would be nice for my scrapbook to be consistent. Plus I like the fact that you have a link that goes from the scrapbook back to your journal.
I think it might be over my head code-wise, though. Plus, the more I think about it, the more I like the fact that I can send people to my scrapbook without them even seeing my lj account. People, in this case, being not-very-computer-literate relatives that just want to see photos of my daughter. Letting them see the pics here is a lot easier than emailing them.
Thanks for the response.
|Top of Page
||Powered by LiveJournal.com|