Rotate pictueres in html Document

S

Samuel Shulman

Is it possible and how to rotate pictures in HTML document

Thank you,
Samuel
 
P

pcx99

Samuel said:
Is it possible and how to rotate pictures in HTML document

Thank you,
Samuel

In straight HTML -- no. In straight HTML+Javascript No.

IE has some CSS filters which may do this but it's propriatary to IE and
won't work in other browsers (And IE no longer commands a 90%+ market
share).

The only real way to do what you want is to use server side scripts to
rotate the image.

In PHP rotating an image is as simple as this.

http://somedomain.com/rotate.php?feed=image.jpg&rot=90

<?php
// File and rotation
$filename = $feed;
$degrees = $rot;

// Content type
header('Content-type: image/jpeg');

// Load
$source = imagecreatefromjpeg($filename);

// Rotate
$rotate = imagerotate($source, $degrees, 0);

// Output
imagejpeg($rotate);
?>
 
S

Samuel Shulman

I was refering to the second option
Or even better that the page will change the images using a timer

Thank you,
Sam
 
D

Dylan Parry

Walton said:

Is this *definitely* from Google? It seems a little fishy to be
perfectly honest. Questions that come to mind include, why didn't Google
host it at http://code.google.com? Also, why is the logo on the top-left
of the page different to the usual Google Code logo?

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

Programming, n: A pastime similar to banging one's head
against a wall, but with fewer opportunities for reward.
 
W

Walton

Is this *definitely* from Google? It seems a little fishy to be
perfectly honest. Questions that come to mind include, why didn't Google
host it athttp://code.google.com?Also, why is the logo on the top-left
of the page different to the usual Google Code logo?

Yes, I'm fairly certain it's from Google. It's on sourceforge because
it's open source. Not sure why logos are different.

Nothing to be fishy about. The code actually works, just a bit slower
than canvas.

this page will show you how to checkout the latest code:
http://code.google.com/p/explorercanvas/source

that has the more familiar google code logo on it.
 
D

Dylan Parry

Walton said:
Yes, I'm fairly certain it's from Google. It's on sourceforge because
it's open source. Not sure why logos are different.
[...]

Ah okay, as long as you're sure ;) The other link you posted helps me to
make my mind up about it being "okay" though.

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

Programming, n: A pastime similar to banging one's head
against a wall, but with fewer opportunities for reward.
 
D

Dr J R Stockton

In comp.lang.javascript message <0p%[email protected]
t>, Fri, 9 Feb 2007 14:18:36, Samuel Shulman
I was refering to the second option
Or even better that the page will change the images using a timer

Don't top-post. Don't over-quote. See FAQ.

Unless you have a near-infinite number of images available, I don't
think you can *change* the image at *every* load by using new Date().

For any one computer, ISTM that, using a cookie, you should be able at
each load to choose at random from the available images excluding that
last shown, thereby ensuring a *change*.

A page can easily change its own images at intervals while running; see
the graphics clocks in <URL:http://www.merlyn.demon.co.uk/js-anclk.htm>.

It's a good idea to read the newsgroup and its FAQ. See below.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top