GetmeUK / ContentTools

A JS library for building WYSIWYG editors for HTML content.
http://getcontenttools.com
MIT License
3.95k stars 395 forks source link

Trouble with image #456

Open Portekoi opened 6 years ago

Portekoi commented 6 years ago

I would like to be able to change an image.

To do that, I click on the exiting image and upload a new one.

But, when I upload a file, width and height are at 1 x 1 image

And the image is not replaced by the new one. What I my doing wrong?

When I valid the page, my new image appear :

image

I've create a sample page : http://portekoi.com/contentTool/test.html

anthonyjb commented 6 years ago

Hi @Portekoi it sounds like your not setting an image size when you insert your image, can you check what the width and height attributes are against the image after it's been inserted by your code in your image uploader?

Portekoi commented 6 years ago

Thanks for your help :)

I have found a solution for my first problem : Size Image by by :

dialog.save(
    response.url,
    response.size,
        {
        'alt': response.alt,
        'data-ce-max-width': response.size.width,
        'width': response.size.width,
        'height': response.size.height
    });
dialog.save(
    response.url,
    [response.size.width, response.size.height],
        {
        'alt': response.alt,
        'data-ce-max-width': response.size.width,
        'width': response.size.width,
        'height': response.size.height
    });

But when I load an image, previous is not replaced by the new one and go on bottom :

image

Portekoi commented 6 years ago

Sorry @anthonyjb to post again but I'm stuck on this problem. Can you take a look when you can? Thanks a lot.

kilobyte2007 commented 6 years ago

Did you solve this? Is there a way of replacing the current image?

Portekoi commented 6 years ago

No, sorry. I've created a SO : https://stackoverflow.com/questions/47401003/contenttool-and-image