If this is specifically designed for mobile, e.g. m.facebook.com or
x.facebook.com and you've already determined if the user is on a
mobile device or not, there's not much more on the server you can
reliably do to determine the screen size. For more recent smart phones
running something Webkit based (Android, iPhone) or Opera mobile you
should be able to get away with interrogating the window property in
JS to determine a maximum width, which you can then use to either
resize images on the fly that are already there (which is what google
reader does) or to write image tags with a size of your choice in the
actual image request, e.g.:

  http://strawp.net/img/daynight/mariosnow/100x100.png

compared with:

  http://strawp.net/img/daynight/mariosnow/300x100.png

which are generated on the fly using PHP (with caching on the server)

you're still then left with devices that can't handle JS at all, to
which I would say the safest bet is not to use images directly in the
layout, rather have them as background images which won't break the
page width. This also has the advantage that if a device can't handle
proper CSS you should hopefully just get reasonably plain HTML.

>From mobile devices I've owned (Winmo, Sony Ericsson, Android) the
user will often have the image either resized for them or have the
ability to zoom out if it's too big.

In summary, I maintain that separation of layout into CSS from content
in HTML and letting the page deteriorate gracefully with the
capabilities of the browser is the sane path forward. Try doing clever
things to make it fit the width if you want, but you probably don't
need to if you have the CSS nailed.

Cheers,
Iain

On Mon, Jul 20, 2009 at 3:48 PM, Brian Butterworth<briant...@freeview.tv> wrote:
> Ian,
> Yes, I agree.
> The width and height is of the maximum picture size.  I'm going to use
> percentages in the CSS for the textual layout, but the images need to be the
> right size for the device, in particular the site header.
> And then there is the question of the phone supporting CSS!
> I was just trying to figure out the phone capabilities first.
>
> 2009/7/20 Iain Wallace <ikwall...@gmail.com>
>>
>> Trying to match the style/layout of a site to the expected resolution
>> of the device that you think is displaying it is going about it the
>> wrong way - this is why CSS has percentage widths for doing layouts.
>>
>> Or is the question more about what you can send back to the server in
>> order to choose an image size?
>>
>> If you want an example of something that does this quite well, visit
>> the iPhone/Android optimised interface for Google Reader using a user
>> agent switcher. This will load up images in atom feeds and then
>> instantly resize them in javascript to fit the page width.
>>
>> On Tue, Jul 14, 2009 at 3:09 PM, Brian Butterworth<briant...@freeview.tv>
>> wrote:
>> > Hi,
>> > I've been looking at adapting some sites to work better on mobile
>> > devices.
>> > I can do the stripping down everything to text and minimal graphics and
>> > so
>> > on, that's the easy bit.
>> > Does anyone know of anything reliable that can tell me the width in
>> > pixels
>> > of the device?
>> > I was hoping that Glow would cover this, but it does't.
>> > --
>> >
>> > Brian Butterworth
>> >
>> > follow me on twitter: http://twitter.com/briantist
>> > web: http://www.ukfree.tv - independent digital television and
>> > switchover
>> > advice, since 2002
>> >
>> -
>> Sent via the backstage.bbc.co.uk discussion group.  To unsubscribe, please
>> visit http://backstage.bbc.co.uk/archives/2005/01/mailing_list.html.
>>  Unofficial list archive:
>> http://www.mail-archive.com/backstage@lists.bbc.co.uk/
>
>
>
> --
>
> Brian Butterworth
>
> follow me on twitter: http://twitter.com/briantist
> web: http://www.ukfree.tv - independent digital television and switchover
> advice, since 2002
>

-
Sent via the backstage.bbc.co.uk discussion group.  To unsubscribe, please 
visit http://backstage.bbc.co.uk/archives/2005/01/mailing_list.html.  
Unofficial list archive: http://www.mail-archive.com/backstage@lists.bbc.co.uk/

Reply via email to