Automatic resize of uploaded images

Related products: Software Factory Windows GUI Intelligent Application Manager Universal GUI Indicium Service Tier

Currently we have two variations when it comes to uploading documents to an application. One where the documents are placed in the filesystem and one where filestreams are used.

In the first one it is possible to resize images when needed, but it's all manual labour. But when filestreams are used, this is no longer the case. 

We are not to keen on limiting the size of uploads, but some users go absolutely mad it seems. We could use different Storage types & locations for various upload columns and limit what kind of files (extensions) are allowed in a default procedure. 

But it would help if we could resize images on the flight when they are beïng uploaded. I've seen JPEGs that could cover a decent size wall when printed, which is totally unnecessary. If the upload control could automatically resize these kinds of images (dimensions, number of colors, DPI etc) based on a setting that's made on a Storage type or on domain level, would be a great feature. Various examples can be found on the web. 

Limiting anything else than images, that's up to the organisations policy.

 

We had the same problem with the images. Many images uploaded by the users are way too big and slow down the user interface. That is why we opted for a solution in SQL with an custom made assembly. There are other ways to resize the images, for example uploading to an API where the resized images are returned. We didn’t want to use such solution because you don’t know wat such party does with this data.

We created a class library in Visual Studio which resizes the images. The input is the original file data and width, the output is the reduced images data.  We loaded the ouput dll into sql and made a function. With the code below, we reduce the images with a width of 200

disadvantage is that this doesn't work in the cloud, you can't add an assemblies here.

It's not quite ready yet but maybe this will help you

declare @org_img nvarchar(max) =  (select base64Image from item cross apply (select image_blob_data '*' for xml path('')) T (base64Image) where item_id = @item_id)

declare @reduced_image varbinary(max) =   CAST(dbo.ClevrrResizeImage(@org_img, 200) AS xml).value('xs:base64Binary(.)', 'varbinary(max)')

update i set image_blob_data = @ reduced_image from item i where i.item_id = @item_id

 


Would be great to have this working for at least various Image extensions as well as for PDF.

If this could be specified with some optional settings per File Storage location, which are then interpreted by Indicium during File upload, we'd be very happy!