Bug #4964

large images are inserted with a size of 0x0

2012-01-20 21:27:19 By: arlomedia
Open Priority: 3 Resolution: None Assigned to: spocke
Description of problem:
If I select a large image in the Insert Image dialog -- either by pasting in a URL, or selecting from an external image list I have defined -- the size on the Appearance tab is set to 0x0 by default. If I don't override these values, the image tag is inserted with width="0" and height="0" attributes, so it doesn't not appear in the editor. Users think the image has not been inserted, but if I view the HTML I can see that it is there.

I don't know what size of image triggers this problem. I don't have the problem with images in the range of 300x300 pixels, but the problem occurs with an image of 780x1701 pixels.

Also, I don't think the problem is with the image itself. This test script runs PHP's getimagesize function on the sample image, and returns the correct size: http://www-dev.revel-blog.com/tests/imagesize.php

Steps to reproduce:
1. Visit fiddle.tinymce.com.
2. With the default setup, click the Insert Image icon.
3. Paste in this image URL: http://www-dev.revel-blog.com/uploads/photos/1/1/10_large.jpg
4. Click the Appearance tab; note that the size is set to 0x0.
5. Click the Insert button. You will not see the image in the WYSIWYG display.
6. Click the HTML button. You will see that the image tag has been inserted, with a size of 0x0.

Expected result:
The image should be inserted with the correct width and height attributes. If the measurement fails, the image should be inserted without the width and height attributes.

Actual result:
The image is inserted with a size of 0x0.


If you wish to follow or post a comment, you need to be registered and logged in.


User Image
  • 2012-01-24 15:38:15


Cant seem to reproduce this in Firefox, there must be something else you do.

User Image
  • 2012-01-24 17:38:42


Hmm, I thought I had seen this in Firefox, but now I don't. I'm still seeing it consistently in Safari 5.1.2 for Mac, using the steps above.

User Image
  • 2012-01-26 15:57:48


Might be a browser bug, not returning correct sizes for huge images or something, but should default to no width/height if its set to 0x0 probably.