?

Log in

No account? Create an account
 

Layout Runtine error

About  

Previous Entry Layout Runtine error Feb. 11th, 2005 @ 05:00 pm Next Entry
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?
Leave a comment
[User Picture Icon]
From:whitaker
Date:February 16th, 2005 10:52 pm (UTC)
(Link)
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?
From:masterslacker
Date:February 17th, 2005 02:55 am (UTC)
(Link)
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.

Thanks,

Mike.
[User Picture Icon]
From:whitaker
Date:February 17th, 2005 03:38 am (UTC)
(Link)
It was a bug that the stipulation wasn't properly enforced. Now if you choose wrong dimensions you should get a 404 not found.
From:reblog
Date:March 8th, 2005 12:52 am (UTC)
(Link)
where did you write your own layout? i can only find ways to customise the layouts already given, and nowhere to create my own...
From:masterslacker
Date:March 8th, 2005 04:19 am (UTC)
(Link)
I'll admit that the navigation to get there is very difficult.

Red bar along the top: Manage -> Styles, then go into "Advanced Customisation", then into "Your Layers"

or, just go to http://pics.livejournal.com/manage/styles/advanced/layers

There you're allowed to create a new layout layer on the core layer. The core layer documentation is at http://pics.livejournal.com/manage/styles/advanced/layerbrowse?id=1

Happy Coding! :)

From:reblog
Date:March 8th, 2005 06:08 am (UTC)
(Link)
huh. wow. i don't think i'm smart enough to understand how to play with any of that. *g* oh well. thanx anyway :)
From:masterslacker
Date:March 8th, 2005 10:13 pm (UTC)
(Link)
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 :)
From:genabear
Date:May 11th, 2005 05:07 am (UTC)
(Link)
Any chance someone else could use your code?
From:masterslacker
Date:May 11th, 2005 12:15 pm (UTC)
(Link)
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.
[User Picture Icon]
From:genabear
Date:May 11th, 2005 02:35 pm (UTC)
(Link)
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.
(Leave a comment)
Top of Page Powered by LiveJournal.com