Opened 3 years ago

Closed 3 years ago

#11910 closed Bug (fixed)

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

Reported by: wwalc Owned by: a.nowodzinski
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 a.nowodzinski 3 years ago.
config.baseHref playground

Download all attachments as: .zip

Change History (14)

comment:1 Changed 3 years ago by wwalc

  • Status changed from new to confirmed

comment:2 Changed 3 years ago by Reinmar

  • Milestone set to CKEditor 4.4.2

comment:3 Changed 3 years ago by a.nowodzinski

  • Owner set to a.nowodzinski
  • Status changed from confirmed to assigned

comment:4 Changed 3 years ago by a.nowodzinski

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

Changed 3 years ago by a.nowodzinski

config.baseHref playground

comment:5 Changed 3 years ago by a.nowodzinski

  • Status changed from assigned to review

comment:6 Changed 3 years ago by a.delura

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

comment:7 follow-up: Changed 3 years ago by pjasiun

  • Status changed from review to review_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 3 years ago by pjasiun (previous) (diff)

comment:8 in reply to: ↑ 7 Changed 3 years ago by a.nowodzinski

  • Status changed from review_failed to review

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 follow-up: Changed 3 years ago by pjasiun

  • Status changed from review to review_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 3 years ago by pjasiun (previous) (diff)

comment:10 in reply to: ↑ 9 Changed 3 years ago by a.nowodzinski

  • Status changed from review_failed to review

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 3 years ago by Reinmar

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

comment:12 Changed 3 years ago by pjasiun

  • Status changed from review to review_passed

Ok, beside this everything works fine.

comment:13 Changed 3 years ago by a.nowodzinski

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

git:8eb72d1 landed in master.

Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy