--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
Look at the documentation for the images service. There is a method that gives you a serving url directly to the CDN.Warning: This method has a surprising amount of latency, you probably want to cache the value in memcache for a reasonable duration.
--On Thu, Mar 1, 2012 at 7:42 AM, Kayode Odeyemi <dre...@gmail.com> wrote:
Hi everyone,
I have images uploaded to the blobstore using filesystem API. The files have been uploaded successfully and I can see the blobs in the respective directory.
But then, how do I decode these files such that when sent back to the client or retrieved using the blobstore API, I'm able to get an image? Right now /blobstore/writable:xxx is not useful for me because when I wrap the path in <img src="/blobstore/writable:xxx" />, it doesn't give me an image.
Any help is appreciated.
Thanks--
--
Odeyemi 'Kayode O.
http://ng.linkedin.com/in/kayodeodeyemi. t: @charyorde blog: http://sinati.com/tree/java-cheat-sheet
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
On Thu, Mar 1, 2012 at 3:03 PM, Jeff Schnitzer <je...@infohazard.org> wrote:Look at the documentation for the images service. There is a method that gives you a serving url directly to the CDN.Warning: This method has a surprising amount of latency, you probably want to cache the value in memcache for a reasonable duration.Can the Image Service work with the filesystem where the blob is stored? Everytime I try to retrieve it using the method you mentioned getServingUrl(blobkey), I get the error:
[java] java.lang.IllegalArgumentException: Failed to read image
[java] at com.google.appengine.api.images.ImagesServiceImpl.getServingUrl(ImagesServiceImpl.java:222)
Also, I'm think this action is not possible on the dev server.
On Thu, Mar 1, 2012 at 7:42 AM, Kayode Odeyemi <dre...@gmail.com> wrote:
Hi everyone,
I have images uploaded to the blobstore using filesystem API. The files have been uploaded successfully and I can see the blobs in the respective directory.
But then, how do I decode these files such that when sent back to the client or retrieved using the blobstore API, I'm able to get an image? Right now /blobstore/writable:xxx is not useful for me because when I wrap the path in <img src="/blobstore/writable:xxx" />, it doesn't give me an image.
Any help is appreciated.
Thanks
--
--
Odeyemi 'Kayode O.
http://ng.linkedin.com/in/kayodeodeyemi. t: @charyorde blog: http://sinati.com/tree/java-cheat-sheet
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
Hello Odeyemi,
If I got your problem right, yes, you can use the Files API to create an image blob, then use the ImageService to create a dedicated URL to serve that image as Jeff said. You can safely cache the generated URL, it will be available as long as you don't delete de blob.
Hello Odeyemi,
If I got your problem right, yes, you can use the Files API to create an image blob, then use the ImageService to create a dedicated URL to serve that image as Jeff said. You can safely cache the generated URL, it will be available as long as you don't delete de blob.
Double check that you called the closeFinally as documented here when creating the blob, and use the method getBlobKey from the Files api to get the blob key after you finalize your file. You can then use this to call the ImageService.getServingUrl(). This proccess works for both your unit tests and the local dev server.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/uX0cs5hKeoEJ.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
On 3/1/12, Jeff Schnitzer <je...@infohazard.org> wrote:
> What are you trying to do?
>
> Jeff
>
> On Thu, Mar 1, 2012 at 2:29 PM, Kayode Odeyemi <dre...@gmail.com> wrote:
>
>> 2012/3/1 Ronoaldo José de Lana Pereira <rper...@beneficiofacil.com.br>
>>
>>> Hello Odeyemi,
>>>
>>> If I got your problem right, yes, you can use the Files API to create an
>>> image blob, then use the ImageService to create a dedicated URL to serve
>>> that image as Jeff said. You can safely cache the generated URL, it will
>>> be
>>> available as long as you don't delete de blob.
>>>
>>> Double check that you called the closeFinally as documented here when
>>> creating the blob, and use the method
>>> getBlobKey<http://code.google.com/intl/en/appengine/docs/java/javadoc/com/google/appengine/api/files/FileService.html#getBlobKey%28com.google.appengine.api.files.AppEngineFile%29>from
>>>> [java] java.lang.**IllegalArgumentException: Failed to read image
>>>> [java] at com.google.appengine.api.**images.ImagesServiceImpl.**
>>>> getServingUrl(**ImagesServiceImpl.java:222)
>>>>
>>>> Also, I'm think this action is not possible on the dev server.
>>>>
>>>>>
>>>>> On Thu, Mar 1, 2012 at 7:42 AM, Kayode Odeyemi
>>>>> <dre...@gmail.com>wrote:
>>>>>
>>>>>> Hi everyone,
>>>>>>
>>>>>> I have images uploaded to the blobstore using filesystem API. The
>>>>>> files have been uploaded successfully and I can see the blobs in the
>>>>>> respective directory.
>>>>>>
>>>>>> But then, how do I decode these files such that when sent back to the
>>>>>> client or retrieved using the blobstore API, I'm able to get an image?
>>>>>> Right now /blobstore/writable:xxx is not useful for me because when I
>>>>>> wrap
>>>>>> the path in <img src="/blobstore/writable:xxx" />, it doesn't give me
>>>>>> an
>>>>>> image.
>>>>>>
>>>>>> Any help is appreciated.
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Odeyemi 'Kayode O.
>>>>>> http://ng.linkedin.com/in/**kayodeodeyemi<http://ng.linkedin.com/in/kayodeodeyemi>.
>>>>>> t: @charyorde blog:
>>>>>> http://sinati.com/tree/java-**cheat-sheet<http://sinati.com/tree/java-cheat-sheet>
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Google App Engine" group.
>>>>>> To post to this group, send email to google-appengine@googlegroups.**
>>>>>> com <google-a...@googlegroups.com>.
>>>>>> To unsubscribe from this group, send email to
>>>>>> google-appengine+unsubscribe@**googlegroups.com<google-appengine%2Bunsu...@googlegroups.com>
>>>>>> .
>>>>>> For more options, visit this group at http://groups.google.com/**
>>>>>> group/google-appengine?hl=en<http://groups.google.com/group/google-appengine?hl=en>
>>>>>> .
>>>>>>
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Google App Engine" group.
>>>>> To post to this group, send email to google-appengine@googlegroups.**
>>>>> com <google-a...@googlegroups.com>.
>>>>> To unsubscribe from this group, send email to
>>>>> google-appengine+unsubscribe@**googlegroups.com<google-appengine%2Bunsu...@googlegroups.com>
>>>>> .
>>>>> For more options, visit this group at http://groups.google.com/**
>>>>> group/google-appengine?hl=en<http://groups.google.com/group/google-appengine?hl=en>
>>>>> .
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Odeyemi 'Kayode O.
>>>> http://ng.linkedin.com/in/**kayodeodeyemi<http://ng.linkedin.com/in/kayodeodeyemi>.
>>>> t: @charyorde blog:
>>>> http://sinati.com/tree/java-**cheat-sheet<http://sinati.com/tree/java-cheat-sheet>
To store upload images as blob using the filesystem api. Then be able
to access the raw image files via a file/url resource path when
wrapped around <img tag or accessed directly through the browser.
--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
Just for curiosity, if you call the getServingUrl() twice for the same blob key, I was expecting that they would generate the same URL. Jeff, did you got different URL's?
Jeff is right, I was actually assuming this behavior by reading this info from javadoc: "If you wish to stop serving the URL, delete the underlying blob key. This takes up to 24 hours to take effect. ". But this don't explicitly states that they will be available forever. Anyway, we are using them for about a year ago.
In my use case, I just needed the files to be stored temporarily using the filesystem api (just for UI purposes). To permanently save the uploaded file, I implemented the blobstore api. This way I don't have to worry about whether the files will be available in the saved directory forever.
So whether the files are written using the Files API or directly uploaded to the blobstore, the blobstore still reside on disk?