Opened 11 years ago

Closed 11 years ago

#11910 closed Bug (fixed)

Image2 does not honor config.baseHref when trying to get image width/height

Reported by: Wiktor Walc Owned by: Olek Nowodziński
Priority: Normal Milestone: CKEditor 4.4.2
Component: General Version: 4.3
Keywords: Cc:

Description

Reported in http://ckeditor.com/comment/131832#comment-131832 by Frank Müller:

In the WYSIWIG view I can see the image, so this shows me that the editor properly combines my "config.baseHref" with "images/large/10061_713.jpg" and calls the server to get the image.

What I found out from reading the code is, that image2 popup loads the image from the server to determine width & height of the image. What I observed is that the "image2" plugin seems not to use "baseHref" to load the image from server. I was expecting that image2 combines ""baseHref" with the relative URL (the one I typed into the "URL" input field).


wwalc: I was able to confirm this, at least in Firefox and Chrome.

Steps to reproduce, assuming that the image is located in /path/to/images/file.jpg:

  • Set config.baseHref to /path/to/
  • In image dialog type URL: images/file.jpg
  • Press tab key so that the width/height value was calculated
  • Result in image dialog: width/height are calculated properly.
  • Result in image2 dialog: width/height are not set at all.

Attachments (1)

11910.zip (8.8 KB) - added by Olek Nowodziński 11 years ago.
config.baseHref playground

Download all attachments as: .zip

Change History (14)

comment:1 Changed 11 years ago by Wiktor Walc

Status: newconfirmed

comment:2 Changed 11 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.4.2

comment:3 Changed 11 years ago by Olek Nowodziński

Owner: set to Olek Nowodziński
Status: confirmedassigned

comment:4 Changed 11 years ago by Olek Nowodziński

Pushed fix to branch:t/11910 (dev).

Changed 11 years ago by Olek Nowodziński

Attachment: 11910.zip added

config.baseHref playground

comment:5 Changed 11 years ago by Olek Nowodziński

Status: assignedreview

comment:6 Changed 11 years ago by Artur Delura

Everything is fine. Tested with diffrent domain as a base URL.

comment:7 Changed 11 years ago by Piotr Jasiun

Status: reviewreview_failed

There is something wrong on IE8:

  1. there are no baseHref in the image URL, images are not displayed; this does not work with both image and image2,
  2. in the sample if you follow described steps but press "tab" key twice image height change incorrectly.

Both may be considered as a separate tickets but with these bugs solution seems not to work on IE8. We need to decide if we fix it now or create a separate tickets.

Last edited 11 years ago by Piotr Jasiun (previous) (diff)

comment:8 in reply to:  7 Changed 11 years ago by Olek Nowodziński

Status: review_failedreview

Rebased branch on latest master.

Replying to pjasiun:

There is something wrong on IE8:

  1. there are no baseHref in the image URL, images are not displayed; this does not work with both image and image2,

That's funny and it took me a while to figure it out. Apparently <base href="..."> never worked properly in IEs but no one noticed it. I fixed it in this commit https://github.com/cksource/ckeditor-dev/commit/ea47726ea4186. See code comments to know more.

  1. in the sample if you follow described steps but press "tab" key twice image height change incorrectly.

Tried in Chrome, FF and IE8 and 9. I was able to reproduce it in IE8 only though. Since it's not related to the ticket, I'm for extracting it somewhere else.

I also pushed a commit https://github.com/cksource/ckeditor-dev/commit/0e2707721eacc5d8d3505dae08aec7811b09efae, which fixes default behaviour when config.baseHref is not set. It looks like neither of you checked if branch breaks default behaviour of the plugin :P

comment:9 Changed 11 years ago by Piotr Jasiun

Status: reviewreview_failed

"Reset size" button in the Image2 plugin dialog does not work on IE8 if I use baseHref. It works if I do not use baseHref.

Last edited 11 years ago by Piotr Jasiun (previous) (diff)

comment:10 in reply to:  9 Changed 11 years ago by Olek Nowodziński

Status: review_failedreview

Replying to pjasiun:

"Reset size" button in the Image2 plugin dialog does not work on IE8 if I use baseHref. It works if I do not use baseHref.

It's a known bug, which concerns getNatural method in Image2 plugin (there's code branching in there). Since the it's quite unlikely to use such combination (IE8, Image2, config.baseHref), it's a low priority issue.

comment:11 Changed 11 years ago by Piotrek Koszuliński

Please stop bouncing this. Extract unrelated or low-prior issues and close it.

comment:12 Changed 11 years ago by Piotr Jasiun

Status: reviewreview_passed

Ok, beside this everything works fine.

comment:13 Changed 11 years ago by Olek Nowodziński

Resolution: fixed
Status: review_passedclosed

git:8eb72d1 landed in master.

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