Guest UChacker11 Posted February 20, 2007 Share Posted February 20, 2007 I am trying to include several images with links in a table. I want to resize the images so that they don't distort the other info on the page, and to create a cleaner look. I have resized the images using <img src="location" height="40" width="40">, but for some reason the jpeg images show up as being empty white boxes with the x in the upper left corner. The bitmaps worked fine though. The syntax is exactly the same for the two different types of images but the jpegs just don't work. Is it something i'm doing wrong or can you not resize jpegs?Thanks in advance. Link to comment Share on other sites More sharing options...
pulpfiction Posted February 20, 2007 Share Posted February 20, 2007 Nothing seems to be wrong with the code.... just make sure the path to image is correct. and the extensionJPEG image: <img src="./foldername/filename.jpg" height="40px" width="40px">Bitmap image: <img src="./foldername/filename.bmp" height="40px" width="40px"> Link to comment Share on other sites More sharing options...
justsomeguy Posted February 20, 2007 Share Posted February 20, 2007 You can display images at any size you want. The browser has to display it at some size, so it doesn't matter if it displays it at normal size or at a size you specify. If you are on a Linux server, the filenames will be case-sensitive, so make sure you are using the correct case. And make sure to URL-encode special characters in the filename like spaces or things like that. Also, just to point out, it's not that great to change an image to a smaller size in a page, because the user still has to download the full-size image. The browser just displays it smaller. So you can have a 1MB image, and maybe you're only showing it at 100x100, but the user still has to download the full 1MB. It would be more efficient to save the image the exact size you want to display it. Link to comment Share on other sites More sharing options...
pulpfiction Posted February 20, 2007 Share Posted February 20, 2007 From you post title "Image resize (.jpeg)"If you are using this extension, then guess thats the error. try .jpg Link to comment Share on other sites More sharing options...
justsomeguy Posted February 20, 2007 Share Posted February 20, 2007 That will work if the file is actually named .jpeg. But only if it is. Link to comment Share on other sites More sharing options...
pulpfiction Posted February 20, 2007 Share Posted February 20, 2007 But normally when you save a jpeg file, default extension will be .jpg... right? Link to comment Share on other sites More sharing options...
justsomeguy Posted February 20, 2007 Share Posted February 20, 2007 Yeah, unless you specify otherwise. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now