Displaying an image - what size can I request?

Started by ubacher, August 28, 2017, 03:34:50 PM

Previous topic - Next topic

ubacher

I copied the following code from "recent apps"
function getImageUrl(id) {
        return IMatch.IMWSUrl() + '/v1/files/image?auth_token=' + IMatch.authToken() + '&id=' + id + '&imagesize=T';
    }


I could not find any documentation for what image sizes can be specified other than T (Thumbnails?)

For completeness: I use above function like this in my script
document.getElementById('pix').src = getImageUrl(allFiles[curIdx].id)


Mario

#1
Did you look at the documentation for files/image in the App Panel?

For the image size parameter it has a link to files/imagesize, which documents the available sizes as follows (this is from the IMWS Documentation App):



The embedded IMWS in IMatch uses the default sizes for LARGE, SMALL and MEDIUM. The /info endpoint returns the sizes in pixels, together with lots of other useful data:

http://127.0.0.1:50519/info?prettyprint=true


...
"cacheSizes":{
      "T":0,
      "N8":800,
      "SMALL":800,
      "N12":1200,
      "MEDIUM":1600,
      "N16":1600,
      "NHD":1920,
      "LARGE":3840,
      "N4K":3840


I think this is pretty much well documented  8) ;)
Using the data returned by the /info request allows an application to dynamically decide which image size to use, depending on the purpose.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

#2
Are your referring to:

http://127.0.0.1:50519/v1/files/image?{auth}&​id=1&​imagesize=LARGE

This returns a blank screen for me. (most of these links return either a blank screen or some (cryptic) text.
I seem to recall that you said these do not work (yet).)


I attach a screen shot of the webservices docu as it appears on my screen.

Mario

#3
QuoteI seem to recall that you said these do not work (yet).)


The /info request works just fine. IMatch uses it all the time, in several apps. They would not work if your IMWS would not deliver data or if /info would not work on your machine. Check out the "Info App" for example. This displays some of the data returned by /info.


Quotesome (cryptic) text.

Of course when you click on a request which returns a binary data stream (the bytes of an image in this case) you won't be able to see anything in your browser...
This is not human readable information. You use links of this type as the src for <img> tags or similar. See, for example, the "HTML Report App" or the "Recently Used" App which use this endpoint t display thumbnails.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Mario, Teacher would have been also a good profession for you.  ;D
You are very good in explaining and if I see at your help-files and your other support-stuff, well, this is what I call "nice teaching", what is not boring.

Your help-file is still outstanding.
Best wishes from Switzerland! :-)
Markus

Mario

I used to teach computer science and programming while studying. I stared with one class when when I left I had 8 each week.
I've also written several books and numerous magazine articles on programming, computer science, object-orientation and project management.
I stopped writing when it did not pay as well anymore...the Internet took over.
I consider a software without documentation as "not delivered". I thing there is even a law covering that in Germany  :D

Look in your other thread for a solution to your "How do I calculate the total of Attributes".

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

QuoteDid you look at the documentation for files/image in the App Panel?

For the image size parameter it has a link to files/imagesize, which documents the available sizes as follows (this is from the IMWS Documentation App):

I can not find the link you refer to. I showed my Webservice documentation window in the screenshot of my previous post. Where is the link supposed to be?
Or are you referring to something other than the Imatch web services documentation app?

Mario

See:



Or just go directly to the documentation of the files endpoint.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

Maybe you don't see this yet because this is a change not yet rolled out to the public.

Just go to /files and there lookup the imagesize parameter.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook