Voodoo Jai Posted August 29, 2008 Share Posted August 29, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/121913-solved-displaying-image-in-a-new-tab-via-php-wrong-size/ Share on other sites More sharing options...
BlueSkyIS Posted August 29, 2008 Share Posted August 29, 2008 an image tag without height and width attributes should display the image at it's actual size. can you show us an example link of the problem? Quote Link to comment https://forums.phpfreaks.com/topic/121913-solved-displaying-image-in-a-new-tab-via-php-wrong-size/#findComment-629117 Share on other sites More sharing options...
Fadion Posted August 29, 2008 Share Posted August 29, 2008 I guess the image is being scaled by the browser. Clicking the image should show it's actual size. That's a browser behavior. Quote Link to comment https://forums.phpfreaks.com/topic/121913-solved-displaying-image-in-a-new-tab-via-php-wrong-size/#findComment-629118 Share on other sites More sharing options...
Voodoo Jai Posted August 29, 2008 Author Share Posted August 29, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/121913-solved-displaying-image-in-a-new-tab-via-php-wrong-size/#findComment-629123 Share on other sites More sharing options...
DarkWater Posted August 29, 2008 Share Posted August 29, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/121913-solved-displaying-image-in-a-new-tab-via-php-wrong-size/#findComment-629134 Share on other sites More sharing options...
Fadion Posted August 29, 2008 Share Posted August 29, 2008 The guy is thinking to disable this functionality, which should be impossible. There may be a local option to prevent resizing, but that's local, you can't override that. At least not that i know. Quote Link to comment https://forums.phpfreaks.com/topic/121913-solved-displaying-image-in-a-new-tab-via-php-wrong-size/#findComment-629138 Share on other sites More sharing options...
Voodoo Jai Posted August 29, 2008 Author Share Posted August 29, 2008 Surely there must be a wayto veride this behaviour as when I just place the image on a page its displayed right. Quote Link to comment https://forums.phpfreaks.com/topic/121913-solved-displaying-image-in-a-new-tab-via-php-wrong-size/#findComment-629142 Share on other sites More sharing options...
DarkWater Posted August 29, 2008 Share Posted August 29, 2008 When directly viewing an image, the browser resizes it. Right-click a large image on a web page and click View Image (or the equivalent in other browsers) and you'll see what I mean. Quote Link to comment https://forums.phpfreaks.com/topic/121913-solved-displaying-image-in-a-new-tab-via-php-wrong-size/#findComment-629147 Share on other sites More sharing options...
Fadion Posted August 29, 2008 Share Posted August 29, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/121913-solved-displaying-image-in-a-new-tab-via-php-wrong-size/#findComment-629152 Share on other sites More sharing options...
Voodoo Jai Posted August 29, 2008 Author Share Posted August 29, 2008 That guys mission accomplished. VoodooJai Quote Link to comment https://forums.phpfreaks.com/topic/121913-solved-displaying-image-in-a-new-tab-via-php-wrong-size/#findComment-629175 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.