I am making a client side Drag and Drop file upload script as a bookmarklet. Before uploading I am using the File API to read the images into base64 format and display them as thumbnails.
This is how my thumbnails look like. I want them to look more square but without loosing their aspect ratio. (please ignore progress bar)
This is how I want the thumbnails to be like, they are centered and being cropped based on min(height,width).
Can I do this using javascript only (changing styles via script will do)? Please try to make sure that your solution will fit with base64 images (after the images are read via file API as DATA URL).
I have uploaded these exact set of images here.
Thanks for the help.