How can we integrate Image Glass into a Web Page

44 views
Skip to first unread message

kami....@gmail.com

unread,
Jul 9, 2019, 6:42:00 AM7/9/19
to ImageGlass Community
Hello!

i am working on a web based document scanning application now i am trying to add a power full image viewer like Image Glass.
 My question is how can i integrate ImageGlass in my Web page that can work on modern browsers like edge,chrome and Firefox without add on or applet or even ActiveX control.
regards,
Kamran

Anon Mouse

unread,
Jul 9, 2019, 10:51:14 AM7/9/19
to ImageGlass Community
Pretty sure the answer is "you can't". You are limited to the image formats which are supported natively in the browser.

If you want a pure-web solution (i.e no conversion by the user on the client side) the only possible solution is:
1. User uploads their image to your server
2. Your server converts it to a browser supported format. You'd use something like ImageMagick for that.
3. The client browser refreshes, loading the converted image from your server

When you are dealing with an image format with capabilities outside the native browser format, you need to inform the user the image they see at step 3 is merely an approximation.

It'd be educational if someone could tell me different ...
Kevin

Dương Diệu Pháp

unread,
Jul 9, 2019, 11:48:54 AM7/9/19
to kami....@gmail.com, ImageGlass Community
Hi Kamran,

You cannot use JavaScript to execute shell script because it's client programming language, and only IE support it.

I created the feature request: https://github.com/d2phap/ImageGlass/issues/557
and spent some times to develop a web protocol for ImageGlass: imageglass:<path>.
This feature is ready in the latest version of ImageGlass Moon, you can download at: https://imageglass.org/moon

To integrate ImageGlass to your website, you should
- Download the latest ImageGlass Moon
- Launch ImageGlass, open Settings > File Associations
- Click on Set as Default Photo Viewer button to register the extensions that ImageGlass supports and web protocol
- In your website, create the following element:
<a href="imageglass:D:\my-photo.jpg">
    Open with ImageGlass
</a>
  With this mock-up, when user clicks on Open with ImageGlass link, ImageGlass will open the file D:\my-photo.jpg
  You can replace the absolute path by relative path, example: %UserProfile%\Downloads\my-photo.jpg
- And now, your task is to 
    + write code to download the image and save into a folder (maybe Downloads) with a name
    + generate the relative path for imageglass protocol

I guess your mock-up should be
<a href="imageglass:%UserProfile%\Downloads\temp-photo-123.jpg">
    Open with ImageGlass
</a>




¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Phap Dieu Duong
Author of ImageGlass software

[Web]        www.imageglass.org
[GitHub]    github.com/d2phap
[Skype]      d2phap




--
ImageGlass community
www.imageglass.org
---
You received this message because you are subscribed to the Google Groups "ImageGlass Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to imageglass+...@googlegroups.com.
Visit this group at https://groups.google.com/group/imageglass.
To view this discussion on the web visit https://groups.google.com/d/msgid/imageglass/bd2d416b-509e-4d5c-a5f4-153a344bb82d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anon Mouse

unread,
Jul 9, 2019, 12:52:04 PM7/9/19
to ImageGlass Community
... and get your users to install ImageGlass!
To unsubscribe from this group and stop receiving emails from it, send an email to image...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages