Solved

How to display a jpg in a popup browser window

Posted on 2011-09-22
8
140 Views
Last Modified: 2012-05-12
Hej,

I have a jpg the is lying on my IIS server and i just want to open a new window and display it with some javascript.

I have the open.window coded ok.. but do i have to do something else (such as the content type) because all i get is a small red cross...
0
Comment
Question by:soozh
  • 4
  • 3
8 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36582824
The new window needs to be web page of it's own.  I guess you could 'pop-up' just the image.  Maybe the path is wrong?  Show me the 'open.window' code.
0
 

Author Comment

by:soozh
ID: 36582957
I dont think there is anything wrong with the open window code.  When i enable directory browsing on my web server and browse/click on the image i still get the small red cross icon.  
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36583168
Ok, the post the image if you can.  JPGs come in more than one 'flavor'.  If you can open it in an image viewer or editor, try saving it under a slightly different name and see if you can view that in IE.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 82

Expert Comment

by:leakim971
ID: 36584099
a red cross? the path of your jpeg is not the right

test page : http://jsfiddle.net/LtdcE/
0
 

Author Comment

by:soozh
ID: 36585282
I can view the image in the standard Windows Image/Fax viewer... but not in IE.
NPAT.DEMO.Katarakt-84.2903.4.205.jpg
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 36585340
The problem is that it is in CMYK mode, not RGB, and IE, at least up to IE8, does not display JPEGs in CMYK encoding.  If you open it in an image program and resave it as an RGB JPG, you'll be able to view it.
0
 

Author Comment

by:soozh
ID: 36585389
Thanks Dave.  How did you discover the coding?
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36585436
In Irfanview http://www.irfanview.com/ , you can press 'I' for information and it tells you that it's a JPEG and CMYK.  Photoshop and other image programs will tell that also.  CMYK color encoding is used for printing while RGB is used for monitors.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question