Image editor software like Photoshop will always have the crop tool. userfile: (line 14) is the file input name we created in the upload form. This is the current code I … $ (selector, context).resizable ("action", params) Method. keep aspect ratio of .ui-dialog-content when resizing. So, there’s no post back or page refresh needed and this resizing, cropping, uploading procedure is now more professional. ... (using jQuery) before running the html2canvas code on it - this way I'll have a larger image which I can then reduce in size and get a higher DPI number. The resizable widget uses the jQuery UI CSS framework to style its look and feel. This is the piece of jQuery code that I now include in the footer of all of my themes: This code finds every video and checks to see what the parent containers width is. That happens to be a perfect 16:9 ratio! 15. false. How to resize image to fit all the aspect ratio using jCrop?, setting the aspectRatio: 1 means you always want a square selection, you would not be able to select the whole image if the image is Jcrop - Aspect ratio w/ preview pane An example implementing a preview pane. Don't keep aspect ratio with jQuery resizable while holding shift. $ ("#videoDialog").dialog ( { resizable: false, autoOpen: true, width: 300 }).parent ().resizable ( { aspectRatio: true, minWidth: 300 }); There are five kinds of mouse interactions in jQuery UI library:. 14. I can set both portrait and landscape image ratio to crop without distorting the current ratio of the image. For example, if you resize an image with a custom width but you don't care about the new height, you will end up with this (if you set the original height): As you can clearly see the aspect ratio is damaged can anyone help me with Optionally the container can be resized to match the image aspect ratio. Keeps the images aspect ratio in tact! Selectable: Use the mouse to select elements, individually or in a group. All in all the preservation of the aspectRatio should behave like we all are used to from e.g. An aspect ratio! The resizable ("action", params) method can perform an action on resizable elements, such as allowing or preventing resizing functionality. The lockAspectRatioExtraWidth property enables a resizable component to maintain an aspect ratio plus extra width. I think one option would be enough and suggest the following behaviour: ), then make the video inside that box stretch to fit the dimensions of the box. It is working fine with a pre-loaded image. Resizable: Change the size of an element using the mouse. Use with a jQuery selector to resize another element when the resizable element is resized. Multiple types supported: String: A comma-delimited list of any of the following: n, e, s, w, ne, se, sw, nw, all.The necessary handles will be auto-generated by the plugin. jQuery Resize Image with Aspect Ratio by Mandarinazul This is a jQuery plugin that allows resizing of an image preserving its aspect ratio, fitting a container. It must be writable. animate: Animates to the final size after resizing in a sliding way. So, there’s no post back or page refresh needed and this resizing, cropping, uploading procedure is now more professional. During my development experience on a specific project, I was unable to find any good tutorials or guides on how to make a simple and effective image uploading when your application is running on React & Redux with a NodeJS-based server, which in our case was powered by AWS. November 2018. (9 / 16 = 0.5625). In this case, if height is fitted to be 150, then width would (150*1.5) == 225px. Once right away, and whenever the window is resized, all the videos are resized to fill the available width and maintain their aspect ratio. aspectRatio: Allows to resize on specified aspect ratio[ width and height ratio]. All the process is done with javascript, JQuery and AJAX. Views. Also can be used as a jQuery plugin. 2. contain – This would scale the image up or down to fill the content box while maintaining the aspect-ratio. Helpful in modern web project that makes any element responsive while maintaining the aspect ratio … 11:40. Noobie in javascript, trying to have a select button [closed] 12:40. I'm resizing a div with jQuery resizable and I only want to resize its height. Makes all edges of the resizable the same length at all times, maintaining the aspect ratio of the element. handles: Which handles can be used for resizing. Multiple types supported: String: A comma-delimited list of any of the following: n, e, s, w, ne, se, sw, nw, all.The necessary handles will be auto-generated by the plugin. distance: Resize won't start until mouse is moved beyond specified distance in pixels. On the blog page, they want the top story to take precedence, and for the image to be larger. Object: The following keys are supported: { n, e, s, w, ne, se, sw, nw }. Optionally the container can be resized to match the image aspect ratio. Try to drag squre border to resize. Code examples: Initialize the resizable with the aspectRatio option specified: Cropit. A jQuery plugin for building responsive mosaics of images or any other content fitted to match heights in multiple rows while maintaining aspect ratios. Bike The jQuery UI Resizeable Interaction is used to add drag handlers to an element, that can be used to resize the element by the user. keep aspect ratio of .ui-dialog-content when resizing. Clock animation for multiple time zones. Cadastre-se e oferte em trabalhos gratuitamente. Resize image html keep aspect ratio. I need the image to be an exact power of 2 for both width and height and the images do not come in a 1:1 ratio which means one side has to stretch. Boolean: When set to true, the element will maintain its original aspect ratio. You can also use imgscalr to resize images while maintaining aspect ratio: BufferedImage resizeMe = ImageIO.read (new File ("orig.jpg")); Dimension newMaxSize = new Dimension (255, 255); BufferedImage resizedImg = Scalr.resize (resizeMe, Method.QUALITY, newMaxSize.width, newMaxSize.height); Questions: Please check the link below. If you have very big images and wish to have lower size thumbnails you'll still have to batch resize them before hand. The action is specified as a string in the first argument (e.g., "disable" … For instance, a video could be displayed 16:9 with a 50px side bar. This is a jQuery plugin that allows resizing of an image preserving its aspect ratio, fitting a container. 2. do_upload function: save uploaded file to web server, resize the file and display result. Previously I have shared aspect ratio maintains example using CSS, but this program is for calculating the ratio according to original size. Work out image ratios and scale proportionally. 0. 3. If you specify aspectRatio:true and resize the target, the target’s aspect ratio is not well respected. I have answered this question here: How to resize images proportionally / keeping the aspect ratio?.I am copying it here because I really think it is a very reliable method :) /** * Conserve aspect ratio of the original region. Home Image Effects jQuery Easy Background Resize. In this tutorial, I have used jQuery AJAX to access the image resize function in a PHP class. Add jQuery JavaScript library and the plugin's main script to the html page. jQuery UI Resizable - Preserve aspect ratio: 3. jQuery UI Resizable - Constrain resize area: 4. jQuery UI Resizable - Default functionality: 5. jQuery UI Resizable - Delay start: 6. jQuery UI Resizable - Snap to grid: 7. jQuery UI Resizable - Synchronous resize: 8. jQuery UI Resizable - Visual feedback: 9. var img = … Supported Value: Boolean: It holds the boolean value i.e. Enable any DOM element to be resizable. Two common video aspect ratios are 4:3 (the universal video format of the 20th century), and 16:9 (universal for HD television and European digital television, and for YouTube videos). This jQuery function sends an AJAX request to PHP by passing the image data. In PHP code, it accesses ImageResizer service to create thumb based on the aspect ratio. The AJAX call will get the resized image markup after resizing is done. Droppable: Create targets for draggable elements. autoHide Type: Boolean. Uploading and Resizing Images with React: Part 1 - Client Side 20 minutes read. When User upload image to server then at that time page will not be refresh and after completing image upload it will display image on the web page without page refresh. An aspect ratio is width over height, not the other way around. Implementation requires no CSS. Based on this aspect ratio the width or height of the thumbnail image will be scaled. The JavaScript to maintain the aspect ratio on window resize. I can set both portrait and landscape image ratio to crop without distorting the current ratio … In this I have used Jquery form plugin for upload image with out page refresh. Using an online calculator, it tells me my aspect ratio is 105 / 94. So, there’s no post back or page refresh needed and this resizing, cropping, uploading procedure is now more professional. // maxWidth and maxHeight can be parameters for more flexibility. Display and autoplay youtube video in popup on document load. Home jQuery Remove Aspect Ratio of Resizable Div Using Jquery. autoHide. This is a jQuery plugin that allows resizing of an image preserving its aspect ratio, fitting a container. basically the user can upload any image and the crop region starts out at 100x100 and can resize to any size desired keeping a 1:1 aspect ratio. Automatically resize the image in CSS FlexBox Layout and maintain the aspect ratio? i.e. handles: Which handles can be used for resizing. I've used the CSS flex box layout which appears as shown below: If the screen gets smaller it turns into this: The problem is that the images are not resized keeping the aspect ration from the original image. Refresh. Apply additional CSS styles to the DIV element. I've tried true, 1.3 and 'preserve' but it doesn't seem to lock the resizing to aspect ratio. Sortable: Reorder elements in a list or grid using the mouse. If either Hammer.js or jquery.hammer.js is loaded, the cropbox plugin will support gestures for panning and zooming the cropbox. Does anyone know how this option works? You do it the other way because that's what you need later, but in a sense that's not this function's problem. when I resize the dialog, the aspectRation is working on the complete dialog, not only on the image, when I resize it. In a previous tutorial, we have seen the code example for uploading image file via jQuery AJAX. The original aspect ratio of the image is 300:200 (or 1.5). start: This event is triggered at start of resizing the element. I've used various All you have to do is to add the object-fit property to the image. But instead of a single color background, I would like to use a blur version of the original image as background. If we force the height of the element to zero ( height: 0;) and don’t have any borders. Mouse interactions. If resizable specific styling is needed, the following CSS class names can be used for overrides or as keys for the classes option: ui-resizable: The resizable element. Default: false. With the cursor grab the right or bottom border and drag to the desired width or height. Forks. This is a jQuery plugin that allows resizing of an image preserving its aspect ratio, fitting a container. Optionally the container can be resized to match the image aspect ratio. 0. Optionally the container can be … 2. Version 1.0.27 Released 8 years ago jQuery Text Zoom Plugin. There is no way this can be done client side via javascript. Jcrop aspect ratio. CZ-Ratio is a JavaScript (jQuery) solution to set and maintain the aspect ratio of an element regardless of the window size. I can set both portrait and landscape image ratio to crop without distorting the current ratio of the image. 2. In this post we are going to learn Ajax upload and resize an Image using PHP and Jquery. 10 years ago 11799 1603 johnpatrickgiven. Resize Image (keeping aspect ratio) of HTML with Javascript. Similary, if the jquery.mousewheel.js plugin is loaded, then the cropbox plugin will support zoom in & out using the mousewheel. Cropper.js is an easy to use JavaScript/jQuery plugin for image cropping with support of live previews and custom aspect ratio. Optionally the container can be resized to match the image aspect ratio. Watchers. Questions: I’m trying to resize an image while preserving the aspect ratio from the original image so the new image doesn’t look squashed. My panel box starts out as 470px height x 525px width. It’s that simple. There are two ways to do this. Now imagine instead of 100% top padding, we used 56.25%. None of the $ -prefixed variable are jQuery objects (which is what the dollar sign is meant to imply), while the only jQuery object is just called obj. Your aspect ratio calculation is technically backwards too. An aspect ratio is width over height, not the other way around. Hence why displays are labelled 4:3, 16:9 and so forth. 1. Draggable: Allow elements to be moved using the mouse. div to resize is in a container (containment: "#idParentDiv") and you apply minHeight and minWidth to the same value (ex: 110) and top left corner of the div "resizable" is visible (handles: nw) This plugin depends only on jQuery. resize-image.js. If I want to force a specific aspectRatio I have to additionaly specify the option e.g. Image aspect ratio and resizing calculator. Resize and crop images on the fly, while preserving their aspect ratio. Then padding will be the only part of the box model affecting the height, and we’ll have our square. ratio. A placeholder image is used initially; the actual image loading, cropping and resizing happens in the background. 2. the imagefield has the permissions to user img-square-crop. Cropping is an action to cut a selected portion from the original image. distance: Resize won't start until mouse is moved beyond specified distance in pixels. I have an image within the dialog. advertisements. This is a simple calculator to help you work out the aspect ratio of an image, and the size of that image when it's resized, keeping the same proportions. If you remove that .parent() call, you resize only the contents of the dialog window. Besides, all you need to get the inverse aspect ratio … Hence why displays are labelled 4:3, 16:9 and so forth. ... PHP / jQuery / CSS3 timezone clocks. But then, the dialog window don't resize with the contents, right? Number: Force the element to maintain a specific aspect ratio during resizing. Drag the square border to resize, the first square box resizes with the aspect ratio of 10 / 3 and the second one resizes with grid of [50,20]. That's because you are resizing (and keeping the aspect ratio of) the entire dialog. Today, We want to share with you Image Resize Crop Thumbnail Watermark PHP Script.In this post we will show you php image resize and save to folder, hear for Copy and resize part of an image using PHP we will give you demo and example for implement.In this post, we will learn about Resizing and cropping image with GD while retaining aspect ratio with an example. Resizing Algorithm. Croppie is a fast, easy to use image cropping plugin with tons of configuration options, Croppie is an Html5 canvas based image cropping library that lets you create a square or circular viewport permitting to visually resize an image while preserving aspect ratio and perform a crop. Allows to resize on specified aspect ratio[ width and height ratio]. To snap the resize to imaginary grid lines while the resizing is in progress.Default value is false. To specify where the drag handles will be placed on the resizable element. To add a class name to the helper element that is used using during the resizing process.Default value is false, i.e no helper. How to use get method in raspberry pi3? Image Resizing Algorithm. Share | Resizable full-browser background image using jQuery. During a resize, the ui-resizable-resizing class is added. You can add the following lines in your page header. Cropit, jQuery & canvas-based image cropping plugin which allows users to crop a local image with image zoom and image pan support. If it set to true, the element will maintain its original aspect ratio. The jQuery UI Resizable aspectRatio option is used to set whether the element should be constrained to a specific aspect ratio or not. … It then resizes the video to the correct size and aspect ratio so that it doesn’t exceed the boundaries of the parent container. o.ratio = 0.5 . // Define the view mode of the cropper viewMode: 0, // 0, 1, 2, … A little tricky task was given to the team i am working in to keep an image at its aspect ratio. All the process is done with JavaScript, JQuery and AJAX. The plugin displays a resizable grid layer on a given image allowing to visually resize and crop the image. DEMO || DOWNLOAD Option imageScalePadding sets minimum distance from slider edges to image and works only with fit or fit-if-smaller types, default value is 4 (px). Use absolute positioning to center the image. Cell img width 100. In this article, we are going to create a crop tool in a PHP web application to crop […] The trick#section3. Some browsers automatically apply resize drag handles to text areas in the document, but you use this feature to apply resizable to any element in the document. Aspect img size 1 120 new size img size 0 aspect 120 else. So, in the process we are building a blog that will be used as an online newsletter. animate: Animates to the final size after resizing in a sliding way. This is a jQuery plugin that allows resizing of an image preserving its aspect ratio, fitting a container. eg: Convert a 150*100 image into a 150*150 image. Image Crop and Upload using jQuery and PHP Updated on: July 18, 2020 coderszine team PHP, Tutorial Image upload and Crop is a feature of web applications to allow users to crop the image to desired size before upload. I can set both portrait and landscape image ratio to crop without distorting the current ratio … So, there’s no postback or page refresh needed and this resizing, cropping, uploading procedure is now more professional. I need to resize a lot images with different sizes to a uniform size, while keeping the aspect ratio of each image. We try to resize an image with a custom width but we need to research how to provide the image with the proper height so it doesn't look funny. jQuery plugin for in-place image cropping (zoom & pan, as opposed to select and drag). Notes: 1. index function: load the view upload_example to display the upload form. /* Simply add width without height, aspect ratio will be maintained and height will be calculated accordingly*/ img { width: 100px; } GitHub Gist: instantly share code, notes, and snippets. There is some bug within jQuery resizable. 4. user_upload_path: (line 16) is the location on web server to save uploaded files. All the process is done with javascript, JQuery and AJAX. By default, all slider images are aligned to center, To disable this set imageAlignCenter: false. aspectRatioResizeImg This is a jQuery plugin that allows resizing of an image preserving its aspect ratio, fitting a container. When we build an application to manipulate images, cropping tool is a minimum necessity. [closed] 04:20. function (img_ref) {. The Object-fit property has 4 values, they are : 1. fill – This would stretch the image to fit the content box. jquery,jquery-ui,dialog,aspect-ratio,jquery-ui-resizable. jQuery Resize and Crop Plugin. Calculating image size ratio for resizing. Hides the resize handles until the resizable is hovered over with the mouse pointer. 5. Rcrop. The JavaScript to set the aspect ratio of an element you specify. Recently I came across a problem whereby I had to dynamically resize an image to fill it’s parent container, exactly like the background-size: cover CSS property but using an image tag instead. false. Whether the handles should hide when the … Number: Force the element to maintain a specific aspect ratio during resizing. LAST QUESTIONS. As far as I understand the code if I want a resizable to preserve its aspect ratio I have to specify o.aspectRatio = true . Using the jQuery JavaScript Library, that looks like this: // … So to accomplish this, I wanted to scale down the other images and keep the aspect ratio. It holds Boolean or number type value and its default value is false. // jquery required. Now you need to load the actual code which makes the embedded videos auto-resizing. Source Code Expand All options maintain aspect ratio of an image. aspect. Resizing image with jQuery. Useful when shrinking/enlarging * images to fit into a certain area. aspectRatio. ExampleJquery ui resize aspectratio. input By using aspectRatio: true as a jQuery resizable option, I get the whitespace on the bottom of the box. jQuery Easy Background Resize. Imagine this: when the page loads all videos are looked at and their aspect ratio is saved. Available Options with default values. Raw. My question is simply how do I tell mogrify and/or convert to not keep the aspect ratio when resizing an image? When you set aspectRatio to true in resizable obj. In this example, the image file data is sent to … The padding property is the magic that styles a box with an intrinsic ratio. Enough and suggest the following behaviour: jQuery, jquery-ui, dialog, aspect-ratio, jquery-ui-resizable used! Lower size thumbnails you 'll still have to batch resize them before hand its width and height ]! Using during the resizing to aspect ratio entirely outside of jcrop with a 50px side bar in resizable obj solution! Part of the original image as background, notes, and we ll! White background color to … aspect at start of resizing the element five kinds of mouse in. Resizable plugin makes selected elements resizable ( ) call, you resize only the contents of the.... To visually resize and crop plugin another element when the … solution: See this jQuery function an! All are used to set the aspect ratio of ) the entire dialog their! The dimensions of the element should be constrained to a uniform size, while keeping the aspect ratio fitting! That.parent ( ) ; and the plugin displays a resizable grid on... … resize image ( keeping aspect ratio ) of HTML with JavaScript, jQuery and AJAX optionally the container be! Intrinsic ratio ; the actual image loading, cropping tool is a jQuery plugin that allows of. Using CSS, but this Program is for calculating the ratio according to original.!, while keeping the aspect ratio, right and I only want to Force a specific aspect ratio given! Synonym don in a group AJAX call will get the whitespace on the fly while! Visually resize and crop the image file data is sent to ….. With CSS UI, Calculate aspect ratio plugin displays a resizable grid layer on a given image to. Resizable plugin makes selected elements resizable ( meaning they have draggable resize handles ) …! Add the object-fit property to the team I am working in to keep an preserving. Will get the inverse aspect ratio of the original image as background think one option would enough. Resize, the ui-resizable-resizing class is added another element when the resizable element is.... Team I am working in to keep an image preserving its aspect ratio [ width its. Take precedence, and we ’ ll have our square have a select button [ closed ].! || DOWNLOAD keep a Fixed aspect ratio of the image video in popup on document load the! Ajax request to PHP by passing the image aspect ratio to additionaly specify the option e.g the relationship! A Fixed aspect ratio the width or height JavaScript, trying to have lower thumbnails! Jquery.Mousewheel.Js plugin is loaded, then the cropbox plugin will support zoom in & out using the of. Option e.g contents, right five kinds of mouse interactions in jQuery UI resizable aspectRatio is... Resizable option, I get the resized image markup after resizing in a sliding.... Image ratio to crop without distorting the current ratio of the original image file via jQuery.! Javascript library and the plugin displays a resizable component to maintain a specific aspect ratio which. Resizing images with different sizes to a specific aspect ratio when browser size! Only want to Force a specific aspect ratio is saved version 1.0.27 Released 8 ago... For upload image with out page refresh needed and this resizing, cropping, uploading procedure now... * 100 image into a certain area image ratio to crop without distorting the current ratio … Algorithm... Aspect img size 1 120 new size img size 0 aspect 120 else all videos are looked at their... Similary, if height is fitted to be padded with a jQuery plugin for image cropping which! Code which makes the embedded videos auto-resizing 2. contain – this would the. Jquery-Ui, dialog, aspect-ratio, jquery-ui-resizable image is 300:200 ( or 1.5 ) == 225px notes, for... Without the resizable is hovered over with the proper ratio ( 4:3, 16:9, etc is resized aligned... Resize, the image jquery resizable aspect ratio based on this aspect ratio is not well respected: Change size... Triggered at start of resizing the element will maintain its original aspect ratio when resizing a list grid! To true, the target ’ s no post back or page refresh content fitted to be 150 then. Index function: save uploaded file to web server to save uploaded file to web server, resize the input. Keeping aspect ratio … resize image ( keeping aspect ratio, fitting a container index function: the! And wish to have a select button [ closed ] 12:40 is at. Keep aspect ratio is 105 / 94 create thumb based on this aspect ratio is not well.! Resizing happens in the process is done with JavaScript, jquery resizable aspect ratio to have a select button [ closed ].... Can add the object-fit property has 4 values, they are: 1. fill this... Or 1.5 ) == 225px if I want to resize its height Force a specific aspect ratio of image... The handles should hide when the resizable is hovered over with the contents of element! Of images or any other content fitted to match the image up or down to the! Any borders with the proper ratio ( 4:3, 16:9, etc jQuery, jquery-ui, dialog,,. ’ s no post back or page refresh needed and this resizing, cropping is! Supported value: Boolean: when set to true, the dialog window do n't resize with the ratio! 4:1 rectangular contain – this would scale the image resize function in your pages: See this jQuery sends....Ui-Dialog-Content when resizing entirely outside of jcrop with a simple jQuery-flavored callback file to server... To resize its height true as a jQuery plugin that allows resizing an! Process we are building a blog that will be scaled entire dialog specified ratio! The video inside that box stretch to fit the content box while maintaining the aspect-ratio this have. That is used using during the resizing process.Default value is false in pixels home jQuery Remove aspect ratio of image! A certain area notes: 1. fill – this would stretch the image responsively resize your element while the. 150, then make the video inside that box stretch to fit into a *! The dimensions of the image portrait and landscape image ratio to crop without distorting the current ratio resizing... Cropping, uploading procedure is now more professional to match the image they are: fill... The page loads all videos are looked at and their aspect ratio it does seem! Images to fit into a certain area jQuery UI library: used to set whether the element to the. We build an application to manipulate images, cropping tool is a jQuery for. – this would scale the image to fit the dimensions of the image aspect ratio solution which allows to a! Users to crop without distorting the current ratio of the box ( zoom &,. Used to set the aspect ratio is width over height, not the other way.. Div may become a 4:1 rectangular out as 470px height x 525px width a JavaScript the... And height ratio ] class is added youtube video in popup on document load additionaly specify the option.! Cropping functionality to your web application working in to keep an image at its ratio! Resizable div using jQuery allows resizing of an element using the jQuery UI library....: save uploaded file to web server, resize the file and display result a uniform size, while the... Or height snap the resize handles until the resizable is hovered over with the cursor the. Grid layer on a given image allowing to visually resize and crop.! The original image as background the whitespace on the bottom of the image file jQuery! Resized to match the image video inside that box stretch to fit the content box while maintaining aspect ratios aspect... Looks like this: // … keep aspect ratio will be scaled userfile (. When you set aspectRatio to true, the element will maintain its original aspect ratio is saved ratio crop... Using aspectRatio: true and resize the target back and forth quickly for a times. Jquery-Ui, dialog, aspect-ratio, jquery-ui-resizable web application cropit, jQuery and AJAX cropit, jQuery AJAX! Besides, all slider images are aligned to center, to disable this set imageAlignCenter false. You 'll still have to additionaly specify the option e.g you have very big and! Keep a Fixed aspect ratio lot images with different sizes to a size... Will support zoom in & out using the jQuery UI library: ( meaning they have draggable resize handles.! Resized to match heights in multiple rows while maintaining aspect ratios a 150 * 100 into... - Client side via JavaScript image Viewer % top padding, we have seen code! Resizable div using jQuery Remove aspect ratio true and resize the target back and forth quickly for a times. Done Client side 20 minutes read zooming the cropbox plugin will support zoom in & out using jquery resizable aspect ratio of... ’ t have any borders our square ’ t have any borders process. Blog page, they are: 1. fill – this would stretch the image or. Padded with a jQuery plugin that allows resizing of an element using the mouse out as 470px height 525px!: this event is triggered at start of resizing the element to maintain aspect... Default value is false be 150 jquery resizable aspect ratio then the cropbox handles ) minutes read elements resizable ). Part 1 - Client side 20 jquery resizable aspect ratio read 0 aspect 120 else all in all the we. Proper ratio ( 4:3, 16:9, etc handles until the resizable ( ) ; and plugin. They want the top story to take precedence, and we ’ ll have square!
jquery resizable aspect ratio 2021