The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Incorrect image rotation Firefox, Chrome & Safari
spruce18b @hotmail.com
post May 13 2020, 03:20 PM
Post #1





Group: Members
Posts: 1
Joined: 10-May 20
Member No.: 27,333



I uploaded my php file with image names in HTML code to my Web site. They were correctly rotated when I viewed them with Firefox but some of the images (portrait and landscape) were incorrectly rotated when I viewed them with Chrome or Safari. The conflicts thus occurred across operating systems and across Web browsers.

I need to modify the PHP code to enable viewers on all platforms to see the images in the correct orientation. Could someone please assist a PHP novice? My PHP file is shown below.

Thanks

spruce18b

<?php
##########################################################################
$password = "hello"; // Modify Password to suit for access, Max 10 Char.
##########################################################################
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Title Los Angeles 2020.php</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
P { FONT-SIZE: 8pt; COLOR: #000000; FONT-FAMILY: Verdana, Tahoma, Arial}
TD { FONT-SIZE: 8pt; COLOR: #000000; FONT-FAMILY: Verdana, Tahoma, Arial}
-->
</style>
</head>
<body>
<?php
print "<h2 align=\"center\">Title Los Angeles 2020</h2>";
// If password is valid let the user get access
if (isset($_POST["password"]) && ($_POST["password"]=="$password")) {
?>
<!-- START OF HIDDEN HTML - PLACE YOUR CONTENT HERE -->
<html>
<head>
<title>Title Los Angeles 2020</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style4 {
font-size: 36px;
color: #0033FF;
}
-->
</style>
<style type="text/css">
<!--
.style2 {
font-size: 20px;
color: #0033FF;
}
-->
</style>
</head>
<body>
<p class="style4">Title Los Angeles 2020</p>
<p class="style2"></p>

<table width="600" border="0"cellpadding="0" cellspacing="0">


<tr><td>
<img src=DSC999.JPG width="450 " height="600 "></td></tr><tr>
<td width="600 " style="color:blue">Caption <br/><br/></td><td width="600 "allign="right"> 14 <br/><br/></td></tr>


</body>
</html>

<!-- END OF HIDDEN HTML -->
<?php
}
else
{
// Wrong password or no password entered display this message
if (isset($_POST['password']) || $password == "") {
print "<p align=\"center\"><font color=\"red\"><b>Incorrect Password</b><br>Please enter the correct password</font></p>";}
print "<form method=\"post\"><p align=\"center\">Please enter your password for access<br>";
print "<input name=\"password\" type=\"password\" size=\"25\" maxlength=\"10\"><input value=\"Login\" type=\"submit\"></p></form>";
}
print "<br><br>";
?>
<BR>
</body>
</html>



User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post May 13 2020, 03:47 PM
Post #2


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



1st thing I would try is fixing your HTML code. Your HTML document is invalid. You have 2 <head>, <body>, etc. There should only be 1 of each.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post May 13 2020, 04:02 PM
Post #3


.
********

Group: WDG Moderators
Posts: 9,628
Joined: 10-August 06
Member No.: 7



QUOTE(spruce18b @hotmail.com @ May 13 2020, 10:20 PM) *

I uploaded my php file with image names in HTML code to my Web site. They were correctly rotated when I viewed them with Firefox but some of the images (portrait and landscape) were incorrectly rotated when I viewed them with Chrome or Safari. The conflicts thus occurred across operating systems and across Web browsers.

Maybe there's something wrong with the image file? I see nothing in the code example that could cause this.

However, the PHP code seems to print the HTML code of a web page inside another one, which is invalid (you can only have one HTML, HEAD and BODY section in a page).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post May 13 2020, 04:28 PM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



Is the image a photo? Image rotation is a mess. Here's a bit about it (first I found, there are probably lots of other pages about the matter).
https://www.howtogeek.com/254830/why-your-p...rectly-rotated/

I've noticed that on some sites where users can upload photos they turn out wrong quite often and on others it never happens. I guess it has to do with the scripts the sites use. I've also noticed that most often an image that's rotated wrong on the page shows up as it should if I view it directly in the browser.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post May 13 2020, 05:35 PM
Post #5


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



I see now that your script doesn't touch the image. So my theory, right as it may be, doesn't apply.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th March 2024 - 06:47 AM