Google provides an excellent way to resize images dynamically; simply append =sXX to the image URL. This is perfect if you want to shrink an image, but if the image is smaller than the size specified, it enlarges it, giving it a pixelated effect.
Is there an easy way to say "don't enlarge, only shrink" when using serving URLs with a specified size?
UPDATE
This functionality is now a feature request at GAE. Vote it up if you'd like to see it!
As stated in my comments above, this isn't possible.
Although I have no use of the image framework I can see how your request would be useful. May I suggest posting a Feature Request on the Google App Engines Issues BB?
After posting the request, update your StackOverflow question with a link to your Feature Request so that other users can +1 the request.
Here's the link to the GAE Issues Page. Although this is not a bug, you will need to click the New Issue button to request a feature.
What you could do is store the size of the image in the datastore so when you need the image to be a certain size, you can check in the datastore to see what size it is and add the =sXX accordingly.
Related
To explain it briefly, I'm trying to share the image as a URL.
But I need to update the image and I hope the URL doesn't change every time.
In other words, I am looking for a feature or site that can update images to the same URL.
I would appreciate it if you could let me know if there is a similar or the same service.
The way that comes to mind now is to add an image to the imgur and go out. We are looking for an alternative because the URL is the same, but it is a way to list images rather than just one image.
I am making android app that must show a lot of images from my REST API. I want to download images, and the next time check for images' name. If the image exists show them from the phone otherwise download from server.
Now I'm using Retrofit for my network requests and Glide for show images. But I have not good idea for solve this issue.
If needed I can change the network library or image loading library.
Thanks in advance
NOTE: This question might be too broad for the liking of S.O.
What you want to do is make what is known as a cache. The idea is that you have a unique identifier (often refered to as a key) for each object in the cache, such as an md5 sum of the image data, or original name + date of creation.
When you want to display an image, you first check if the image exists in the cache. If it exists simply return with the image from cache. if it does not exist, start the download and upon completion you insert the image into the cache.
Here is an example implementation that does what you want. I cannot vouch for it's quality because I never tried it.
I have some image urls which I want to cache locally and save so that I don't need to make a web request again and again as needed.
Now, I am confused whether there is any significant benefit of using webclient's openreadasync method over bitmap for fetching the image for first time for saving it to IsolatedStorage.
For me, I think bitmap would be a better option as I would be able to get a event for progress.
This post gives good info on various image caching options.
http://blogs.msdn.com/b/swick/archive/2011/04/07/image-tips-for-windows-phone-7.aspx
Matt mentioned the fact that default image caching only works per session. So if you are implementing your own Image caching, then you will have to implement a image downloader for which the WebClient OpenReadAsync provides a way to store file locally
If you were't considering a local cache, UriSource would have been the choice.
If you want to cache images beyond the current application instance lifetime, have a look at http://blogs.msdn.com/b/delay/archive/2010/10/04/there-s-no-substitute-for-customer-feedback-improving-windows-phone-7-application-performance-now-a-bit-easier-with-lowprofileimageloader-and-deferredloadlistbox-updates.aspx which will show a way of saving the images to IsolatedStorage and then display it from there. This means you won't have to get it over the network each time the app is run.
If you're using this for lots of images be sure to manage the images you save as well so you don't fill up the disk with lots of old images you'll never need again.
I m using latest php sdk. I can post to wall with this api. message,picture can be posted to user wall. But the picture is as thumbnail and as link.
Bu I saw some apps on facebook which post full image in wall.
How can I do this. So that PHP genered image can be posted to user wall with full size.
thanks
You probably want to look into Explicit Sharing on open graph actions. By marking an action as explicitly sharing, the post is treated like a status update and has a chance to be shown as a standalone story with a full size picture (such as Instagram, Foursquare, etc.)
I've got an app on Google App Engine that will accept image uploads from users. The problem that I envision is that users will upload these images directly from their cameras, and file sizes are often greater than 1MB, which is the limit for the image API (which would be used to resize the images).
What's the best way to accept the upload of say a 1.5MB image file, and resize it to under 1MB?
While this is not clear in the App Engine documentation, this is possible by using a combination of the Blobstore and the Image Manipulation Service.
You must:
Upload the Image into the Blobstore
Retrieve the Image from the Blobstore
Perform the Image Manipulation with an Image resulting in less than 1mb in size
I've written up a post about this -> http://socialappdev.com/uploading-and-re-sizing-large-images-on-app-engine-11-2010.
Here are two (similar) ways to solve this:
If you want to keep everything controlled yourself, you can put a resize script on a server of yours, which takes the URL to the raw uploaded image (which can be up to 10MB due to HTTP response size limit, but you would have to store it as 1MB chunks in the datastore), downloads it from your application, resizes it, and then POSTs it back to your application. All this interaction would need some kind of authorization of course, so that it can't be abused. Alternatively, POST the image directly to your external server, but then you have to either send the other form data back to your application, or use a separate form for the image upload.
Use an external imaging service. I would recommend Picnik. See their API documentation. As you can see, it lets you make a form that posts the image directly to their servers, then the user can edit the image (and resize), then the image is posted back to your server. With this solution you have to upload the image in a separate form, since Picnik receives all your POST data.
I recommend point 2, because it doesn't require you to go around Google App Engine limitations and since your users are uploading images straight from the camera, they will probably want to do something with them anyways (such as crop.)
That's a conundrum. The "obvious" answer, using google.appengine.api.images.resize, won't work because it's too big. :) So you will have to use third-party software, either on the server (which will be tricky because of App Engine's limitations) or the cilent (e.g. a Java uploader).