Ticket #481 (closed Bug: fixed)

Opened 2 years ago

Last modified 7 weeks ago

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

481.patch (1.3 KB) - added by martinkou 17 months ago.
481_2.patch (1.3 KB) - added by martinkou 17 months ago.

Change History

Changed 2 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.

Changed 2 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'

Changed 2 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?

Changed 2 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

Changed 2 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.

Changed 2 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 ;
	}

Changed 17 months 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 17 months ago by martinkou

Changed 17 months ago by martinkou

  • keywords Review? added
  • owner set to martinkou
  • status changed from new to assigned

Changed 17 months 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 17 months ago by martinkou

Changed 17 months ago by martinkou

  • keywords Review? added; Review- removed

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

Changed 17 months ago by fredck

  • keywords Review+ added; Review? removed

Changed 17 months ago by martinkou

  • status changed from assigned to closed
  • resolution set to fixed

Fixed with [1576].

Click here for more info about our SVN system.

Changed 7 weeks ago by advseb

  • cc adv.seb@… added
  • status changed from closed to reopened
  • version changed from FCKeditor 2.4.2 to FCKeditor 2.6.4
  • resolution fixed deleted

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.

Changed 7 weeks ago by alfonsoml

  • status changed from reopened to closed
  • version changed from FCKeditor 2.6.4 to FCKeditor 2.4.2
  • resolution set to fixed

This ticket was closed 15 months ago.

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

Changed 7 weeks ago by advseb

Here you go: #3536

Note: See TracTickets for help on using tickets.