Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Open a .png with Photo Viewer from a web link

08 Dec 2018   #1
rhinse

Windows Home Premium 32bit
 
 
Open a .png with Photo Viewer from a web link

I have an unusual request. I would like to use Photo Viewer to open a .png file which is
referenced by a link in a web page. This png file resides on my computer and will open
by default with Photo Viewer if clicked on in Explorer. The web page link I have been trying
looks like:


<a href="file:///C:/images/file.png">Image</a>


This will open the file in a separate web page but as a static image with no way to zoom
as in Photo Viewer. I don't want to alter the behavior of Firefox when a png image is presented
in a web page (i.e. use Photo Viewer); that would be disastrous and I'm not sure it can be done
anyway.



How can I make this web link open the image file with Photo Viewer?


My System SpecsSystem Spec
.
08 Dec 2018   #2
samuria

win 8 32 bit
 
 

You would have to set it in Firefox
My System SpecsSystem Spec
4 Weeks Ago   #3
Alejandro85

Windows 7 Ultimate x64
 
 

The HTML standard and web browsers in particular are specifically designed to avoid what you want. If any website could open a program on your computer, it would be security chaos!

If all you want is to be able to zoom the image, that's a browser capatility, so, use a different browser or add a plugin for your current one and you're done.

If not, there are still a couple of ways you can get that to work, always including modifications to your local system and the HTML markup.
Have a look here: Force to open "Save As..." popup open at text link click for PDF in HTML - Stack Overflow
Basically it boils down to trying one of those alternatives. Put a "download" attribute in the link (which some browsers may ignore):
Code:
<a href="file:///C:/images/file.png" download>Image</a>
Then when asked by the browser, chose open instead of save and your default program for handling images will open it.

Another option is to register a new protocol and use it to open your program. Look at here: windows - How do I create my own URL protocol? (e.g. so://...) - Stack Overflow
Here you need to change the HTML to use your specific protocol, say like this:
Code:
<a href="photoviewer://C:/images/file.png">Image</a>
Then you would need to add the "photoviewer" protocol to the registry and make it open the file it receives. This will only work in the system it's made such modification.

Other than those dirty tricks, it isn't possible with normal HTML.
My System SpecsSystem Spec
.

Reply

 Open a .png with Photo Viewer from a web link




Thread Tools




Similar help and support threads
Thread Forum
Documents in Libraries Now Show Only Open with Windows Photo Viewer
All of the documents, regardless of how they were created and saved (word, pdf, etc.) now have an icon showing they open with Windows Photo Viewer. However, when I click on document to open it, there is this message "Windows Photo Viewer can't open this picture because either Photo Viewer doesn't...
General Discussion
Windows Photo Viewer won't open
On my Windows 7 machine, Windows Photo Viewer will not open. I double click an image so I can view it but it will not open. I click it a number of times, it still won't open. At this point, I open the task manager and see that COM Surrogate (dllhost.exe) which houses Windows Photo Viewer is running...
Music, Pictures & Video
Notepad & windows Photo Viewer will Not Open Please Help
Having the following issues with Notepad and Windows Photo Viewer will not open. Windows 7 Ultimate 64 Bit Retail version. Have full administrator and UAC is turned off. Installed windows several months ago thru elevated command prompt. Start/all Programs/accessories/Notepad right click...
General Discussion
Windows Photo Viewer can't open .jpg
Since few days ago there are no thumbnails on my newly downloaded .jpg's. I'm using Opera 16.0 Internet browser. When I open my pictures in Windows Photo Viewer it says: "Windows Photo Viewer can't open this picture because either Photo Viewer doesn't support this file format, or you don't have...
Music, Pictures & Video
Can't open Photo Viewer (RunDLL)
Hello, when I try to open Photo Viewer I get this error message : "There was a problem starting E:\Programmes\Windows Photo Viewer\PhotoViewer.dll The system cannot find message text for message number 0x%1 in the message file for %2." I tried the solutions in these links : Error loading...
Music, Pictures & Video


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 17:16.
Twitter Facebook Google+