Jump to content

[SOLVED] Displaying image in a new tab via php wrong size


Voodoo Jai

Recommended Posts

I have a piece of code that takes a db value for an images location and displays it in another window. It works fine but the image is being scaled down, I want it to be viewed full size.

 

Here is the code:

 

   echo "<a href=\"menus/$menuView\" target=\"_blank\">VIEW</a>";
   echo "<img src=\"images/window.jpg\" alt=\"View takeaway food menu\"> view menu<br/>";

 

I presume I have to get the images height and width attribs but the problem is every image is a different size.

 

Hope you can help me.

 

Many thanks in advance

VoodooJai

I guess the image is being scaled by the browser. Clicking the image should show it's actual size. That's a browser behavior.

 

That is what is happening I have been trying the "getimagesize" function but as you say its the browser thats taking over the dimensions, can it be overidden.

 

 

I guess the image is being scaled by the browser. Clicking the image should show it's actual size. That's a browser behavior.

 

That is what is happening I have been trying the "getimagesize" function but as you say its the browser thats taking over the dimensions, can it be overidden.

 

 

The browser should have a way to "zoom" (really just making normal dimensions).  In FF, you just put your mouse over it an a magnifying glass appears, so you click.  In IE, I think you hold the mouse over it for several seconds and then a box appears in the top-right for you to click.

Displaying the image in an html page will display it right. Displaying the image in the browser without the proper html formatting will display it resized. If you want to override the behavior, make html pages for each image.

 

EDIT: DarkWater beat me to it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.