Integrate ImageGlass 7 to your website using Web-to-App linking

Phap Duong
Aug 1, 2019 · 3 min read

A guy asked me a question that he had an internal web-based document scanning application and he wanted to view the scanned photos by ImageGlass on his web app. This was a challenging request and I almost wanted to reply him that it’s impossible! However, in a few seconds, I suddenly thought of Skype, this app somehow allows user to open chat window when they click on the username hyperlink. Another example is when using mailto: in href of hyperlink, it will trigger the default email app with the pre-filled email address. I spent few more hours to research and it’s done eventually.

In this post, I will teach you how to integrate ImageGlass 7 to your website with few simple lines of code.

What is ImageGlass Web-to-App linking?

A special protocol associates to ImageGlass app, allows user to launch ImageGlass with argument in order to view the local image files.

The protocol syntax

imageglass:[path]

  • imageglass: is the protocol, this helps to launch ImageGlass app.
  • [path] is an optional argument to pass to ImageGlass app when it launches.

How to register the protocol?

Web-to-App linking is also registered when you set ImageGlass as default photo viewer app. If you haven’t done it, you can open Settings dialog, go to File Associations tab, and click on Set as Default photo viewer button.

File Associations tab in Settings dialog

You also can do it by command line: igtasks.exe reg-uri-scheme

To test the protocol, you can open web browser and type imageglass: to the address bar, it should open ImageGlass app. You can include a folder or image file path as well.

Open ImageGlass by protocol

💡 Tip
ImageGlass also supports relative path!

Sample codes

The sample code snippets below are to create 3 hyperlinks:

Sample code

Open ImageGlass with blank window

<a href="imageglass:">
Open ImageGlass with blank window
</a>

Open an image file by ImageGlass

<a href="imageglass:%UserProfile%\Downloads\sample.svg">
Open an image file by ImageGlass
</a>

Open image files in Downloads folder by ImageGlass

<a href="imageglass:%UserProfile%\Downloads">
Open image files in Downloads folder by ImageGlass
</a>

Most of users do not need this Web-to-App linking feature, but if you are IT administrator or web developer who want to develop an web-based application for your company network, I believe this is really useful to you.

If you have not updated to ImageGlass 7.0, you can always download it at https://imageglass.org, and let me know your feedback by commenting below! 👇🏿

Phap Duong

Written by

Author of ImageGlass and Frontend developer of Chainstack. I love JavaScript and C#; recently exploring blockchain world.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade