IIIF image processing like iiifhosting.com - image-processing

I want to know that is there any existing feature that cantaloupe offer to resize low resolution images to high resolution like iiifhosting.com is doing?
For example, if I have image of 1000x750 and upload it to directory. When i access with cantaloupe end point url like,
{scheme}://{server}{/prefix}/{identifier}/info.json
https://example.org/image-service/abcd1234/info.json
I got width = 1000 and height = 750 of image in json response.
I want to increase that width and height of image to something like 6117x4112.
I am asking this because i am using mirador viewer in my web application and mirador viewer does not zoom in and zoom out low resolution images.
Before that i was using iiifhosting.com now i want to setup my own server.
When i upload images on iiifhosting.com like i have uploaded 1000x750 image on iiifhosting.com and when i access image info.json
{scheme}://{server}{/prefix}/{identifier}/info.json
it gives me width and height of image to higher scale like some greater values 6117x4112. Please let me know how i can achieve that.
Thanks.

Related

How iiifhosting site processing images to up/down scale to make it compatible to iiif?

My question is regarding IIIF. I am using iiifhosting.com but now i want to setup my own server. I want to know how iiifhosting.com processing my images to high resolution?
I have uploaded an image of 2000x1000 and when i get info.json i got width: 11658, height: 6112. Check this url.
http://bafdev.iiifhosting.com/iiif//e6ebb551407a5c64903d100ab8ba9199bb264d1c17cdcf0a9e745cd6c5aea432/info.json
When i try to get full image and save it its just only 1000x524
http://bafdev.iiifhosting.com/iiif//e6ebb551407a5c64903d100ab8ba9199bb264d1c17cdcf0a9e745cd6c5aea432/full/full/0/default.jpg
I want to know how iiifhosting doing this? Any clue?
1- iiifhosting is not upscaling images. It only shows image information which image have. There is no conversion in image to high resolution. In info.json you are getting image info how much width height it has and tiles sizes. Tile sizes formula is (smallest dimension) * 1/2n > endpoint.iiif.min_tile_size
endpoint.iiif.min_tile_size is which you set in cantaloupe.properties file default is 512x512
2- http://bafdev.iiifhosting.com/iiif//e6ebb551407a5c64903d100ab8ba9199bb264d1c17cdcf0a9e745cd6c5aea432/full/full/0/default.jpg
Regarding your second point there is restriction to get full resolution image on iiif hosting so you cant get full image of their client files. Therefore they are serving maximum of 1000x1000 image.
Second thing is if iiifhosting client have 2gb images (very high res) and you request 100 images on your site than it will overwhelm image server.

Force user to crop/upload an image to a certain size? Preferably using filepicker

I have users uploading images using filepicker, but I want them to have to upload an image of a certain size (and crop if the image is too big). I could cut it myself, but then it won't look good. Ideally, the user would crop it themselves.
I've tried this page: https://www.filepicker.com/documentation/file-ingestion/widgets/pick?v=v2 and I've tried various options but nothing seems to work quite well.
data-fp-image-min doesn't prevent users from uploading smaller images. data-fp-crop-force along with data-fp-crop-max and data-fp-crop-min doesn't do the trick either.
I'm open to using other image uploading libraries, but I like using filepicker. Seems like this is something other people would have run into.
I'm using rails btw.
From the docs:
data-fp-image-min - Images smaller than the specified dimensions will be upscaled to the minimum size.
So it doesn't really prevent users from uploading smaller images.
data-fp-crop-max and data-fp-crop-min specifies the maximum and minimum dimensions of the crop area so it won't give you specific dimensions.
I would recommend you to:
Set data-fp-crop-ratio - Specify the crop area height to width ratio. User will be able to adjust the crop area for each photo with desired ratio.
Set data-fp-crop-force="true" - User could not skip cropping image.
Then resize image to specific height or width.
This will result, you will always get the image with the desired dimensions.
Example for 150 x 200 image output:
Html widget:
<input type="filepicker"
data-fp-crop-ratio="3/4"
data-fp-crop-force="true"
mimetype="image/*"
onchange="window.upload(event)"
data-fp-apikey="APUGwDkkSvqNr9Y3KD4tAz" />
Javascript:
window.upload = function(event){
console.log(JSON.stringify(event.fpfile));
var listElem = document.createElement("li");
var image = document.createElement("img");
/*
set w=150 (width) conversion option
so all images would be 150x200
and crop_first option to make sure the image is cropped
before any other conversion parameters are executed.
*/
image.setAttribute('src', event.fpfile.url + '&w=150&crop_first=true');
listElem.appendChild(image);
document.getElementById('results').appendChild(listElem);
};
Here is working solution: http://jsfiddle.net/krystiangw/9o9ebddL/

Responsive image size both image (pixel) size and file (byte) size just like in Google plus

The link below is an example image link I got from google plus. If you change the width value of the URL, the image size change as well and it has a smaller file size. For example, change the width from 1017 to 100
http://lh6.googleusercontent.com/-Eanf6uMoTPI/VaP0qYA_jUI/AAAAAAAAJcc/dOua5XQcjPE/w1017-h678-no/IMG_9439.jpg
File size: 216.8kB
http://lh6.googleusercontent.com/-Eanf6uMoTPI/VaP0qYA_jUI/AAAAAAAAJcc/dOua5XQcjPE/w100-h678-no/IMG_9439.jpg
File size: 12.5 kB
Can someone please give an advice on how can I have this feature in my web application, regardless if it uses file system or database. This feature is ideal for displaying thumbnails or resizing images.
Thanks in advance
My solution to this (by the way) was to use SLIR application by Lencioni. It can crop or resize without altering the original image. It uses a cache to store the resized images to lessen the server load.
https://github.com/lencioni/SLIR

ios: image resize as per screen resolution

I am displaying image thumbnails from urls(which are in json file) into custom cells of a tableview.
The images loaded from url are not showing up properly- they are of a resolution much higher than need and some are of much lower resolution.
How do I manipulate these images so that they are scaled properly as per each screen(retina as well as normal) in iphone?
How do I scale and resize the thumbnail images from url?
Unless you care about other issues like memory or disk usage (for some caching) for the images, you don't have to resize them.
You can use UIViewContentModeScaleAspectFit as contentMode for an UIImageView and just set an image for the image view. It would be sufficient for you.

How can I scale an image with ColdFusion without losing resolution?

Server Config:
Windows Server 2003
IIS 6
ColdFusion 8 Standard Edition
Java Version 6 Update 18
I have a ColdFusion application that allows users to upload images that will be added to an existing PDF. When the images are added to the PDF, they have to fit within a minimum/maximum height and width, so the uploaded image needs to be scaled to fit.
For instance, let's say the minimum height and width for a given image is 100x100, and the maximum height and width is 200x200, and the user uploads an image that is 500x1000. I use the logic below to scale that image down without skewing the image (it keeps its original shape) to 100x200. For an image smaller than the minimum, it is scaled up (in the example above, a 50x50 image would be scaled up to 100x100).
The problem I'm noticing is that when ColdFusion scales the image using its built-in functions, it reduces the resolution to 72dpi. Is there a way to prevent this loss of resolution, as the images are being added to PDFs which need to be print-quality?
Here's the [scaled-down] code I'm using to scale the images:
<cfscript>
imagePath = "/uploads/image.tif";
scaledWidth = 100;
scaledHeight = 100;
scaledImage = ImageNew(imagePath);
ImageSetAntialiasing(scaledImage, "on");
ImageScaleToFit(scaledImage, scaledWidth, scaledHeight);
</cfscript>
I think you may want to skip scaling the image at all and add the original image to the pdf document. Then have whatever pdf creation tool you are using "resize" and position the image on the document canvas. Similar to setting width and height on images in html to something other than its native resolution. I have not had to add images to PDFs docs like you described but this post might point you in the right direction:
Adding a dynamic image to a PDF using ColdFusion and iText

Resources