How to add image options: cropping, resizing, etc. to http image file - html

I would like to know how do I add image options the image size on request. I have seen something like:
http://exampleimage.png?w=120&h=200
Sometimes they even add options to crop, zoom, etc. Thanks in advance.

Related

Way to get un-cropped thumbnail images?

Can anyone advise if / how to get un-cropped thumbnail images of files in drive?
Thumbnails in the Recent files component appear to be un-cropped (if you use browser inspector), whereas thumbnails in the component below it are below are cropped. While you can change the size of the thumbnail in its url query params, this doesnt solve the cropping problem.
Im building a redesigned frontend - using css grid for a more irregular aesthetic - as a learning project. To do this, Id need to get un-cropped images - to, for example, show documents as vertical rectangles, not the standard square cropped thumbnail. Id appreciate it if you have any ideas on this. Thanks!

Replace an image in Google Slides with Apps Script with same croping

I'm trying to replace an image in a Google Slide by a smaller version of it (in terms of bytes).
The smaller image should be displayed exactly the same way than the older.
But when my original image was croped, I cannot reproduce it with the new one.
What I'm doing is simple (I'm using this replace method)
let image = page.getImages()[0];
let newImageUrl = optimize(image.getContentUrl()); // API call to get an optimized image. newImage will have the same width and height
image.replace(newImageUrl, true);
A visual example.
Here is my slide before (pay attention to the "Quick" logo at the bottom right corner)
And here is the result after replacing it (you can see that the bounding box is the same, it takes the same space in the slide, but the image itself is lower)
How can I reproduce the croping that I've initially done in my slide with that button ?
Thanks
Issue:
As mentioned in comments, crop properties are currently read-only, so this cannot be done. Here are possible workarounds: https://stackoverflow.com/a/63256489, https://stackoverflow.com/a/64040404, https://stackoverflow.com/a/67309702.
Feature request:
There's a feature request in Issue Tracker. Anyone interested in this, consider starring it:
Why are Image Crop Properties read only

phonegap put gif on image loading till it is loaded

I have a phonegap application that loads external images.
sample img code:
<img src="http://example.com/hello.jpg">
Will use this code to put the gif with some css
<img src="loading.gif">
I want to show a loading gif on top of the image till the image has been loaded and hide the loading gif afterwards.
Want to know how to detect if image is ready and hide the gif.
Thanks
There are a few ways to do that. Off the top of my head and in order I'd try them:
Use phonegap's File API to download the image, and display it only once you've got it.
Use an XHR to download the image, and once you get the whole thing send it to the image via a data: URI.
Set your "loading.gif" image to a lower z-order than the foreign image, with the same left/top/height/width.
Use 'loading.gif' as a background.

iTunes API: get 100x100 px icon of an App

I'm using iTunes API to get some informations about apps in App Store.
Reading the documentation I saw that "artworkUrl100" parameter, taken from JSON request, will get me a 100x100 icon of the app.
I notice that this not works always, and sometimes it contains the url of a biggest icon.
Is there a way to get with certainty this icon (100x100 px)?
You can do that like this.
Let say this is your link:
http://a223.phobos.apple.com/us/r1000/049/Purple/e0/ed/59/mzi.qaoavtgs.png
(from "artworkUrl512").
You just have to add .100x100-75 before .png like this
http://a223.phobos.apple.com/us/r1000/049/Purple/e0/ed/59/mzi.qaoavtgs.100x100-75.png
Also ju can adjust icon size you need by adding different values like .150x150-75. Only problem is that this -75 part depends on icon size. it can also be -50 for smaller or -65 for middle size icons. I still did not figure that out.
Hope this helps you.
EDIT:
You do not have to worry about .jpg or .jpeg. You can replace all with .png it will work.

How to capture zoomable image as one high resolution image?

I would like to capture a zoomable image at a high resolution zoomed at 3x. Do you know of a way I can piece this image together without having to do it manually? Here is the image
After using bhups' solution, tweaking outputxand outputy for a good while, I tried something else.
I went back to the object page (in the above example, here), took the thumbnail image URL (http://www.metmuseum.org/Imageshare/ep/regular/DP145931.jpg), replaced regular with zoom and to my surprise got what I presume is the full image, with less effort:
http://www.metmuseum.org/Imageshare/ep/zoom/DP145931.jpg
You can tweak the URL to get the job DONE. Here is the URl for 3x image. http://media.metmuseum.org/mgen/metzoom/zoom3.ms?img=DP145931.jpg&wrapperid=11&outputx=1200&outputy=1601.067378252168&level=1&x=0&y=0&backcolor=0x00000
outputx and outputy are the output image dimensions. level implies the zoom level. and x and y are the top left corner of the selected rectangle.