Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ContentEditable image resize in chrome, what is the best solution?

I'm trying to integrate image resizing using contentEditable on Chrome. I know there are problems with webkit about the normal operation of this feature, so I was wondering what is the best alternative method for the integration of image resizing in case a user uses Google Chrome (jQuery plugins? Javascript methods?).

<div contenteditable>
  <img src="http://www.thebrandbite.com/wp-content/media/2015/07/apple-7.jpg" width=200 />
</div>

Here is how it works out-of-the-box with Firefox:

enter image description here

like image 736
user2806879 Avatar asked Oct 03 '13 17:10

user2806879


People also ask

How do I resize an image in Chrome?

Click on the extensions icon next to your Google Chrome profile icon. Select the Resizing App extension and a pop-up screen will appear. Here, you will have to select the + icon to add an image. Select the resize option from the drop-down menu and add the dimensions.

Which tool is used for resize an image?

My dear: crop tool is use to cut and resize the image.

How do I resize an image in image processing?

Description. Resize the image to a new width and height. To make the image scale proportionally, use 0 as the value for the wide or high parameter. For instance, to make the width of an image 150 pixels, and change the height using the same proportion, use resize(150, 0).


1 Answers

@Tim-Down Answer is probably the better solution. But I want to throw out there, that you can resize images with just CSS, if you don't want to do anything further with it:

http://codepen.io/anon/pen/JEEKqO

    resize: both;
    background-size: contain;
    background-repeat: no-repeat;
    background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/photoshop-face-after.jpg);

body {
  background-color: #1D1F1F;
}

section { 
  display: table;
  margin: 0 auto;
}

div {
  resize: both;
  background-color: white;
  overflow: scroll;
  background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/photoshop-face-after.jpg');
  background-size: cover;
  background-repeat: no-repeat;
} 
<section>
  <button>both</button>
  <button>horizontal</button>
  <button>vertical</button>
  <button>none</button>
<div class="resize"></div>
</section>
like image 196
Type-Style Avatar answered Oct 17 '22 01:10

Type-Style