Opened 17 years ago

Closed 15 years ago

Last modified 13 years ago

#481 closed Bug (fixed)

FF: Image preview doesn't display

Reported by: ludovic BODENES Owned by: Martin Kou
Priority: Normal Milestone: FCKeditor 2.6
Component: General Version: FCKeditor 2.4.2
Keywords: Confirmed Review+ Cc: adv.seb@…

Description

In firefox only, When you select an image in image manager , the height and width are set to 0 in preview . If you want to display you must click on refresh .

Attachments (2)

481.patch (1.3 KB) - added by Martin Kou 16 years ago.
481_2.patch (1.3 KB) - added by Martin Kou 16 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 Changed 17 years ago by Alfonso Martínez de Lizarrondo

Keywords: Pending added

Works fine for me in http://www.fckeditor.net/demo with Fx 2.0.0.3 , windows XP.

Please provide detailed steps to reproduce.

comment:2 Changed 17 years ago by ludovic BODENES

I use Fc 2.0.0.3 and windows Xp and it an be reproducted on demo version.

1 click image button

2 click browse server .

3 upload a image

4 click on it

5 the image appear in preview then disappear with width and height postionned to '0'

comment:3 Changed 17 years ago by Frederico Caldeira Knabben

Keywords: Confirmed added

Partially confirmed with FF2.

It seams to happen only if the image is not in the cache, with images that are not too small, therefore taking some time to download in the preview window. No problem with small images.

In my tests, the dimension fields are not being set to 0, but remain blank. Also, the image in the preview doesn't disappear at all.

blodu, can you confirm that the bug is like I've described?

comment:4 Changed 17 years ago by ludovic BODENES

Oh, the preview doesn't work as before, it's my fault , i have no cache with my FF ( a plugin FF) .

So it's not a bug, i close my case .

Sorry

comment:5 Changed 17 years ago by Frederico Caldeira Knabben

Keywords: Pending removed
Milestone: FCKeditor 2.6

Thanks for the update bludo. We still need to fix this one, as the fields remain blank, instead of getting the image sizes.

comment:6 Changed 17 years ago by Paul Moers

It definitely seems to be having something to do with the cache. I'm using Firefox 2.0.0.6 + the Web developer add-on version 1.1.4. To reproduce, turn off the cache and open the image dialog (cache must be off before opening the dialog!), then browse server and select an image. Now (most of the time) for any image (also small images, with 6k being the smallest that I've tried) the width and height inputs are set to zero.

It seems to me that the onload function, that calls 'ResetSizes', set in UpdateOriginal is triggered before the width and hight of oImageOriginal are known (browser bug?). A fix that seems to be working is to add the code below, in function ResetSizes before its input populating code.

	if ( oImageOriginal.width == 0 || oImageOriginal.height == 0 ) {
		setTimeout(ResetSizes, 10) ;
		return ;
	}

comment:7 Changed 16 years ago by Paul Moers

Not in the image manager, as that is a plugin, but in the standard image dialog.

This still happens in Firefox 2.0.0.11 using FCKeditor 2.5.1. Just by clicking 'Insert/edit image' > 'Browse server' > select an image. Again with the cache turned off, it happened most of the times.

Changed 16 years ago by Martin Kou

Attachment: 481.patch added

comment:8 Changed 16 years ago by Martin Kou

Keywords: Review? added
Owner: set to Martin Kou
Status: newassigned

comment:9 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed
Summary: image preview does'nt display in firefoxFF: Image preview doesn't display

The proposed patch may potentially put the dialog in a 10ms loop if the image sizes are really 0x0 (for an invalid image file, for example).

As this is a FF only issue, we could try to check oImageOriginal.complete instead, and than recall the function after 10ms.

If .complete will not work, then we should at least limit the number of retries to 10 (passing the counter as a parameter to the function).

Changed 16 years ago by Martin Kou

Attachment: 481_2.patch added

comment:10 Changed 16 years ago by Martin Kou

Keywords: Review? added; Review- removed

Updated patch to use img.complete and increased the polling delay to 50ms for better performance.

comment:11 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

comment:12 Changed 16 years ago by Martin Kou

Resolution: fixed
Status: assignedclosed

Fixed with [1576].

Click here for more info about our SVN system.

comment:13 Changed 15 years ago by advseb

Cc: adv.seb@… added
Resolution: fixed
Status: closedreopened
Version: FCKeditor 2.4.2FCKeditor 2.6.4

I reopen this bug, because I'm experiencing this problem with the following configuration:

Firefox: 3.0.10 FCKEditor: 2.6.4 Drupal: 6.12

I tried increasing the wait time to 1000ms without success. Sometimes the correct image size is used, sometimes it is 0x0.

comment:14 Changed 15 years ago by Alfonso Martínez de Lizarrondo

Resolution: fixed
Status: reopenedclosed
Version: FCKeditor 2.6.4FCKeditor 2.4.2

This ticket was closed 15 months ago.

Please open a new ticket with the proper reproduction steps for your issue

comment:15 Changed 15 years ago by advseb

Here you go: #3536

comment:16 Changed 13 years ago by hedrick

This bug seems to be fixed in the version I have. However the check for Firefox should be extended to include Safari as well. I saw the same problem there, and the following fixed it:

Index: src/webapp/editor/FCKeditor/editor/dialog/fck_image/fck_image.js =================================================================== --- src/webapp/editor/FCKeditor/editor/dialog/fck_image/fck_image.js (revision 2649) +++ src/webapp/editor/FCKeditor/editor/dialog/fck_image/fck_image.js (revision 2650) @@ -384,7 +384,7 @@

function ResetSizes() {

if ( ! oImageOriginal ) return ;

  • if ( oEditor.FCKBrowserInfo.IsGecko && !oImageOriginal.complete )
+ if ( (oEditor.FCKBrowserInfo.IsGecko
oEditor.FCKBrowserInfo.IsSafari) && !oImageOriginal.complete )

{

setTimeout( ResetSizes, 50 ) ; return ;

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy