473,386 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Image rotation

Jez
I'm looking at using random image rotation on one of my sites and have
found the following script very helpful:

http://www.alistapart.com/d/randomizer/rotate.txt

Everything works, but once you've randomly chosen the file on the
server wouldn't it be simpler/quicker to say ...

if ($img!=null) {
header("Location: ".$img."");
}

instead of ...

if ($img!=null) {
$ext = strrchr($img,'.');
if ($ext==".jpg") $ext = ".jpeg";
$contentType = 'Content-type: image/' . substr( $ext, 1,
(strlen($ext)) );
header ($contentType);
readfile($img);
}

I'm no expert, but this seems to work for me.

Please let me know if I've got this all wrong?

Thanks!

Jez
Jul 17 '05 #1
1 3018
"Jez" a écrit le 19/11/2003 :
I'm looking at using random image rotation on one of my sites and have
found the following script very helpful:

http://www.alistapart.com/d/randomizer/rotate.txt

Everything works, but once you've randomly chosen the file on the
server wouldn't it be simpler/quicker to say ...

if ($img!=null) {
header("Location: ".$img."");
}

instead of ...

if ($img!=null) {
$ext = strrchr($img,'.');
if ($ext==".jpg") $ext = ".jpeg";
$contentType = 'Content-type: image/' . substr( $ext, 1,
(strlen($ext)) );
header ($contentType);
readfile($img);
}

I'm no expert, but this seems to work for me.

Please let me know if I've got this all wrong?


Because the first one force the Web Client to show only the image
whereas the second could be used in a HTML page in a <img> tag.
Assuming you php page is rotate.php with the second you could use in
any HTML page :
<img src="rotate.php" alt="My rotated image">
You simply can't whith your method.
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Deepa | last post by:
Hi All, I'm facing problem displaying image of size 5000X5000 .My window size is smaller than image size so i'm not able to see the complete image.i can use scroll bars to view the image but i...
2
by: Andreas Viklund via DotNetMonster.com | last post by:
Hi! I am developing an application in ASP.NET that takes an image, that have been created with a digital camera or camera phone, and processes it, to get data from it. The image taken by the user...
17
by: santel_helvis | last post by:
Hi All, Could anyone tell me how to rotate the image in javascript. Which concepts I should concentrate to rotate the image
3
by: Mark Szlazak | last post by:
The following page simulates a pool cue and cue ball: http://members.aol.com/myscript/cue.html Mouse cursor position around the cue ball determines where a roll-over of 179 pool cue images is...
5
by: Russell Warren | last post by:
Does anyone have an easier/faster/better way of popping from the middle of a deque than this? class mydeque(deque): def popmiddle(self, pos): self.rotate(-pos) ret = self.popleft()...
5
by: Ricardo Furtado | last post by:
I'm trying, for a week or two, to create a procedure in order to rotate the image in any picturebox control in a cephalometry software. I've found a web site that shows how that can be done:...
9
by: Ohann | last post by:
Hi I have a page with 9 images on, each one placed within a table cell. I want to be able to have a different image displayed each time the page is refreshed as well as being able to have the...
3
by: kimiraikkonen | last post by:
Hi, Here is a very interesting issue, Assume i have picturebox and loaded a image into picturebox, however whenever i want to rotate image using: 'For example 90 degree...
8
by: infoseekar | last post by:
Image Resize & Rotation Hi I have 2 scripts, one for Image rotation and other image resize and they both are working. Image resize scripts load the picture and resize it and Image rotation...
3
by: chvennela | last post by:
Hi, how to make complete rotation any image in html/css <img src=C:\Users\Desktop\DSC00583.JPG" height=300 widht=200 style="image-rotation:90deg;">
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.