dropzone.js - dropzone - change the thumbnail size -


I want to upload a file and width to fit in a given div and I want to set the height, depending on the file size. Example:

  div size: width: 600px, height: 300px img size: width: 1200px, height: 400px   

with thumb width 600 and height 300 ( thumbnail withth and thumbnailHight options)

on In the case of success, I want to get the image and width of the diode at 600px, but I want to change the height to 200 (so that the image does not get distorted)

My The problem is now that the image How to fix the source (data) in a width of still 300px

Any ideas? Thanks!

Change the size change:

 , resize: function (file) {var info; // Clip Arekcitr (image, srcX, srcY, srcWidth, srcHeight, trgX, trgY, trgWidth, trgHeight) takes an image, it is rectangular (srcX, srcY, srcWidth, srcHeight), this dimension (trgWidth, TrgHeight), and coordinates (trgX, trgY) on draws // it on canvas. Info = {srcX: 0, srcY: 0, srcWidth: file.width, srcHighight: file.height, trgX: 0, trgY: 0, trgWidth: this.options.thumbnailWidth, trgHyight: parseInt (it. Options. Thumbnail Width * File .high / file.width)} return information; },    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -