Opened 9 years ago

Closed 7 years ago

Last modified 6 years ago

#481 closed Bug (fixed)

FF: Image preview doesn't display

Reported by: bludo Owned by: martinkou
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 martinkou 8 years ago.
481_2.patch (1.3 KB) - added by martinkou 8 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 Changed 9 years ago by alfonsoml

  • 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 9 years ago by bludo

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 9 years ago by fredck

  • 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 9 years ago by bludo

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 9 years ago by fredck

  • Keywords Pending removed
  • Milestone set to 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 9 years ago by saul11

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 8 years ago by saul11

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 8 years ago by martinkou

comment:8 Changed 8 years ago by martinkou

  • Keywords Review? added
  • Owner set to martinkou
  • Status changed from new to assigned

comment:9 Changed 8 years ago by fredck

  • Keywords Review- added; Review? removed
  • Summary changed from image preview does'nt display in firefox to FF: 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 8 years ago by martinkou

comment:10 Changed 8 years ago by martinkou

  • Keywords Review? added; Review- removed

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

comment:11 Changed 8 years ago by fredck

  • Keywords Review+ added; Review? removed

comment:12 Changed 8 years ago by martinkou

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed with [1576].

Click here for more info about our SVN system.

comment:13 Changed 7 years ago by advseb

  • Cc adv.seb@… added
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version changed from FCKeditor 2.4.2 to FCKeditor 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 7 years ago by alfonsoml

  • Resolution set to fixed
  • Status changed from reopened to closed
  • Version changed from FCKeditor 2.6.4 to FCKeditor 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 7 years ago by advseb

Here you go: #3536

comment:16 Changed 6 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 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy