Image Resize Issue

Hi All,

We would inquire if the following problem can be related to CSP as defined
by the W3C and its browser implementation.

The process related to CSP (Image resize function)

- Site gets loaded by the browser
- Image is loaded by the URL defined in an <img> tag’s src parameter.
- JavaScript-event load is triggered
- Image size is obtained of <img>
- Image is resized

Example Code:

<script type="text/javascript">
$(function() {
$('#img-001').bind('load', function(){
imgWidth = $('#img-001').css('width').replace('px', '');
<img id="img-001" src="test.jpg">

Following problems occurs:
Rarely, in Internet Explorer 11, the image’s real size can not be obtained.
In that case, the obtained size seems to be IE11’s default value of 28x30px
for images.

What we would like to confirm
Could the problem be related to CSP?

Why we think the problem might be related to CSP
Although we changed our code to be CSP compliant, we saw no improvement. (We moved inline scripts to external
sources and changed the meta tags as required by CSP)

We did contact Microsoft Support and got the following response: “Internet
Explorer does not support CSP, so the problem is not related to it.”

Does the W3C think as well that the problem doesn’t seem to be related to

Takao Nakagawa

Received on Friday, 24 January 2020 08:28:09 UTC