Jump to content

Welcome! You're currently a Guest.

If you'd like to join in the Discussion, or access additional features in our forums, please sign in with your Evernote Account here. Have an Evernote Account but forgot your password? Reset it! Don't have an account yet? Create One! You'll need to set your Display Name before your first post.

Photo

How To display a image resource


  • Please log in to reply
1 reply to this topic

#1 Aanchal

Aanchal

  • Pip
  • Title: Member
  • Group: Members
  • 5 posts

Posted 03 June 2012 - 02:15 AM

Hi,
I am a novice with evernote api's
What I am trying to do is display images from the notebook and was wondering how to do that.

Till now I am able to get the resource objects from the notes. The resource object looks something like this


Resource(guid:a12d19cb-33f7-40df-ae2f-044c9ef99577, noteGuid:3dbdf31b-8e81-4baf-9e98-53adc83d6096, data:Data(bodyHash:04 7D A8 F5 C9 D4 8D 8B 79 4D 33 7D CD 68 C4 72, size:158637, body:FF D8 FF E0 00 10 4A 46 49 46 00 01 02 01 01 2C 01 2C 00 00 FF E1 0D 3D 45 78 69 66 00 00 4D 4D 00 2A 00 00 00 08 00 07 01 12 00 03 00 00 00 01 00 01 00 00 01 1A 00 05 00 00 00 01 00 00 00 62 01 1B 00 05 00 00 00 01 00 00 00 6A 01 28 00 03 00 00 00 01 00 02 00 00 01 31 00 02 00 00 00 14 00 00 00 72 01 32 00 02 00 00 00 14 00 00 00 86 87 69 00 04 00 00 00 01 00 00 00 9C 00 00 00 C8...), mime:image/jpeg, width:600, height:600, active:true, recognition:Data(bodyHash:61 CF 0E B8 2C 11 34 EF 3D E0 2C B5 B8 6D 2B 4F, size:292), attributes:ResourceAttributes(fileName:03.jpg), updateSequenceNum:11)

This is how I am able to get the resource

Note n = noteStore.getNote(accessToken,note.getGuid(),false,true,false,false)
List<Resource> res = n.resource

As you can see this is an image object. Now I am wondering how to get the url to this resource so that I can use it in the img tag on my view. Like what should I set as the src in
<img src="/>.

The documentation does not talk about how to display a resource. Appreciate if I could get help on this.

-Aanchal

#2 Julien Boedec

Julien Boedec

  • Title: Browncoat
  • Group: Evernote Employee
  • 408 posts

Posted 03 June 2012 - 04:08 PM

In you wish to keep copies of the images, you will need to download the resources (like you are doing right now), create the associated files on your server or machine by putting them in a accessible folder and use the URL or path in your img tag.

For a local applications (desktop and mobile), if you don't wish to keep a local copy of the files you may use their direct URL on our service.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Clip to Evernote