Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Resolution: Fixed
    • Security Level: All-users
    • Labels:
      None

      Description

      I have just installed PS 1.5.3.1 with the sample products on localhost. If I use any of my theme, the products images will not be displayed in IE9.

      Using default theme is okay. Even if I copy the default theme and rename it (with exact same default theme files inside), IE9 still won't display the images.

      When I view the source, the image height and width are not specified in the source >>> height="" width=""

      Other browser still display with this not specified height and width in the html, but IE9 will not display.

        Activity

        Hide
        hsyong hsyong added a comment -

        Basically, this means ONLY "default" theme is useable. With any other theme, IE9 will not display product images (because width and height not specified in the html of the images)

        Show
        hsyong hsyong added a comment - Basically, this means ONLY "default" theme is useable. With any other theme, IE9 will not display product images (because width and height not specified in the html of the images)
        Hide
        Pelle Andersson added a comment -

        Experience exact the same problem. Using a modified theme from 1.5.2. Running 1.5.3.1. No images in IE at all. All sizes in html source is blank (width="").

        Show
        Pelle Andersson added a comment - Experience exact the same problem. Using a modified theme from 1.5.2. Running 1.5.3.1. No images in IE at all. All sizes in html source is blank (width="").
        Hide
        Robert Pasztor added a comment -

        Experienced the same issue when upgraded to 1.5.3.1. The images were not displayed in the list in IE9 but were visible in Chrome.
        This happens because as the reporter described width and height are generated empty even if the homeSize is set.

        I've "dirty fixed" it by hardcoding the width and height of the images generated by product-list.tpl:

        {if isset($homeSize)}

        width="{$homeSize.width}" height="{$homeSize.height}"

        However somebody have to fix the real cause since this is propagated in many other places.

        Show
        Robert Pasztor added a comment - Experienced the same issue when upgraded to 1.5.3.1. The images were not displayed in the list in IE9 but were visible in Chrome. This happens because as the reporter described width and height are generated empty even if the homeSize is set. I've "dirty fixed" it by hardcoding the width and height of the images generated by product-list.tpl: {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}" However somebody have to fix the real cause since this is propagated in many other places.
        Hide
        Anat Kitithamrong added a comment - - edited

        Same result on IE8

        But I have 1 theme developed from default theme on 1.5.2 which still work on IE8 after upgraded to 1.5.3.1 except the product thumbnails were missing. (thumb_list)

        my only theme using:

        -module overriding (eg. homefeature, block categories, homeslider)
        -custom images type (for bigger picture of the product shown in my website)

        my screen shot can be found here: http://www.sendspace.com/file/12uip8

        Show
        Anat Kitithamrong added a comment - - edited Same result on IE8 But I have 1 theme developed from default theme on 1.5.2 which still work on IE8 after upgraded to 1.5.3.1 except the product thumbnails were missing. (thumb_list) my only theme using: -module overriding (eg. homefeature, block categories, homeslider) -custom images type (for bigger picture of the product shown in my website) my screen shot can be found here: http://www.sendspace.com/file/12uip8
        Hide
        Daniel Wilden added a comment - - edited

        The Core of modules take size from old names image properties, like "home", "large"....

        For example:

        Wrong Line 111 from homefeatured.php at PS 1.5.3.x
        'homeSize' => Image::getSize(ImageType::getFormatedName('home')),

        Correct line 112 from homefeatured.php at PS 1.5.2
        'homeSize' => Image::getSize(ImageType::getFormatedName('home_default')),

        Show
        Daniel Wilden added a comment - - edited The Core of modules take size from old names image properties, like "home", "large".... For example: Wrong Line 111 from homefeatured.php at PS 1.5.3.x 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), Correct line 112 from homefeatured.php at PS 1.5.2 'homeSize' => Image::getSize(ImageType::getFormatedName('home_default')),
        Hide
        hsyong hsyong added a comment -

        @Daniel Wilden,

        Thanks for the explanation. But I'm confused, why does it work okay with "default" theme? But any other theme, the width and height can't be retrieved properly? Shouldn't it be a problem for default theme as well?

        Show
        hsyong hsyong added a comment - @Daniel Wilden, Thanks for the explanation. But I'm confused, why does it work okay with "default" theme? But any other theme, the width and height can't be retrieved properly? Shouldn't it be a problem for default theme as well?
        Hide
        Jiri Zinke added a comment - - edited

        I wonder if there is some solution which can be offered to client who purchased template and upgraded to 1.5.3, except workarounds like renaming the theme directory to default. I tried to create new image types e.g.: mytheme_large etc. It displays the images in IE then (because width and height attributes are generated) but images itself are loaded in the size of large_default so it's not usable either. The only working solution I found was to create those image types with theme name prefix and also change the default image types to required value. Is there any real solution or is it a bug?

        EDIT: Creating custom image types (small_mytheme) in admin and implementing them into tpl files seems to work. But this is very uncomfortable for developers because using this approach they have to create tpl files in theme modules folder for ALL modules that contains default image types and rewrite them to keep the theme flexible (abbility to use any module). It would be great if image types works same way for custom themes as for default. Also for the installer, it should work the same way as in 1.4 (ability to rewrite sizes of default image types during installation of new theme).
        In addition, there are some other bugs related to images in 1.5.3 (manufacturer-list.tpl doesn't show logos).

        Show
        Jiri Zinke added a comment - - edited I wonder if there is some solution which can be offered to client who purchased template and upgraded to 1.5.3, except workarounds like renaming the theme directory to default. I tried to create new image types e.g.: mytheme_large etc. It displays the images in IE then (because width and height attributes are generated) but images itself are loaded in the size of large_default so it's not usable either. The only working solution I found was to create those image types with theme name prefix and also change the default image types to required value. Is there any real solution or is it a bug? EDIT: Creating custom image types (small_mytheme) in admin and implementing them into tpl files seems to work. But this is very uncomfortable for developers because using this approach they have to create tpl files in theme modules folder for ALL modules that contains default image types and rewrite them to keep the theme flexible (abbility to use any module). It would be great if image types works same way for custom themes as for default. Also for the installer, it should work the same way as in 1.4 (ability to rewrite sizes of default image types during installation of new theme). In addition, there are some other bugs related to images in 1.5.3 (manufacturer-list.tpl doesn't show logos).
        Hide
        Jiri Zinke added a comment -

        This also makes theme variations unusable (see this issue http://forge.prestashop.com/browse/PNM-611)

        Show
        Jiri Zinke added a comment - This also makes theme variations unusable (see this issue http://forge.prestashop.com/browse/PNM-611 )
        Hide
        Iggy Pritzker added a comment -

        I renamed images names in preferences / image from xxx_default to xxx_mytheme and now explorer can get my size, but other browsers still can't get image sizes.

        Show
        Iggy Pritzker added a comment - I renamed images names in preferences / image from xxx_default to xxx_mytheme and now explorer can get my size, but other browsers still can't get image sizes.
        Hide
        Daniel Wilden added a comment -

        If you rename image names in preferences, new images are create in you img directoy whiout removing the old images, your images directory will be increased twice. Same case if you create a new image preferences. The old images place on img directory.

        You template take the size of the renamed or new image preference (home), but show the old image file (home_default). if you remove the old images from img directory (default_home.jpg), you template show nothing.

        I have update my prestashop from 1.5.2 to 1.5.3.1 and change to default template and the images dont show on IE.

        Show
        Daniel Wilden added a comment - If you rename image names in preferences, new images are create in you img directoy whiout removing the old images, your images directory will be increased twice. Same case if you create a new image preferences. The old images place on img directory. You template take the size of the renamed or new image preference (home), but show the old image file (home_default). if you remove the old images from img directory (default_home.jpg), you template show nothing. I have update my prestashop from 1.5.2 to 1.5.3.1 and change to default template and the images dont show on IE.
        Hide
        Win Suseno added a comment -

        Here's the solution ...

        The problem was introduced by new function in 1.5.3 namely getFormatedName() in /classes/ImageType.php which returns $theme_name.'_'.$name_without_theme_name by default if it cannot find the definition under Preferences > Images.

        It should return $name_without_theme_name

        I think the idea was so that a theme developer could specify the images' sizes using the Preferences > Images.
        For example, theme 'mytheme' could specify different size of by adding 'small_mytheme' to the Preferences > Images.

        Now, this introduces at least another problem:
        If one changes the Theme's name, then one has to change the name of all images under Preferences > Images pertaining to the Theme's name.

        I think a better solution is to implement this image size feature on the Preferences > Themes just like the new 'Mail Color" feature.

        Therefore, you have 2 options:

        1. Add image size definitions on the Preferences > Images (e.g. 'small_mytheme')
        2. Change (or copy it to override folder and modify it) the root of the problem in file /classes/ImageType.php on line 153

          Before
          return $theme_name.'_'.$name_without_theme_name;
          


          After

          return $name_without_theme_name;
          
        Show
        Win Suseno added a comment - Here's the solution ... The problem was introduced by new function in 1.5.3 namely getFormatedName() in /classes/ImageType.php which returns $theme_name.'_'.$name_without_theme_name by default if it cannot find the definition under Preferences > Images. It should return $name_without_theme_name I think the idea was so that a theme developer could specify the images' sizes using the Preferences > Images. For example, theme 'mytheme' could specify different size of by adding 'small_mytheme' to the Preferences > Images. Now, this introduces at least another problem: If one changes the Theme's name, then one has to change the name of all images under Preferences > Images pertaining to the Theme's name. I think a better solution is to implement this image size feature on the Preferences > Themes just like the new 'Mail Color" feature. Therefore, you have 2 options: Add image size definitions on the Preferences > Images (e.g. 'small_mytheme') Change (or copy it to override folder and modify it) the root of the problem in file /classes/ImageType.php on line 153 Before return $theme_name.'_'.$name_without_theme_name; After return $name_without_theme_name;
        Hide
        Jiri Zinke added a comment - - edited

        Thank you Win Suseno for your explanation.
        As a theme developer I'm already using solution 1) to keep my themes compatible but this has many problems which I already reported above. One more is that Prestashop then generates twice more images and waste the free space of server. One question: using solution 2) makes images working with default image types, right? If yes, it's great, unfortunatelly theme developers can't force clients to edit core files so I hope Prestashop team will fix this asap. I also think it would be great if 1.5. theme installator works as 1.4 (able to override default image definitions according to theme Config.xml).

        Show
        Jiri Zinke added a comment - - edited Thank you Win Suseno for your explanation. As a theme developer I'm already using solution 1) to keep my themes compatible but this has many problems which I already reported above. One more is that Prestashop then generates twice more images and waste the free space of server. One question: using solution 2) makes images working with default image types, right? If yes, it's great, unfortunatelly theme developers can't force clients to edit core files so I hope Prestashop team will fix this asap. I also think it would be great if 1.5. theme installator works as 1.4 (able to override default image definitions according to theme Config.xml).
        Hide
        hsyong hsyong added a comment - - edited

        Thank you everyone for the ideas and comments. I wonder where are the PrestShop mods? No response at all.

        @Jiri Zinke and @Win Suseno,

        It was mentioned by Win Suseno "or copy it to override folder and modify it".... is it possible to override the core file /classes/ImageType.php ?

        Thanks.

        Show
        hsyong hsyong added a comment - - edited Thank you everyone for the ideas and comments. I wonder where are the PrestShop mods? No response at all. @Jiri Zinke and @Win Suseno, It was mentioned by Win Suseno "or copy it to override folder and modify it".... is it possible to override the core file /classes/ImageType.php ? Thanks.
        Hide
        Win Suseno added a comment -

        @Jiri Zinke
        Solution 2). Yes, it'd behave like PS 1.5.2
        Great idea > define the images in the Config.xml of the theme.

        @hsyong hsyong
        I believe it is possible by copying the /classes/ImageType.php to /override/classes/ImageType.php.

        Show
        Win Suseno added a comment - @Jiri Zinke Solution 2). Yes, it'd behave like PS 1.5.2 Great idea > define the images in the Config.xml of the theme. @hsyong hsyong I believe it is possible by copying the /classes/ImageType.php to /override/classes/ImageType.php.
        Hide
        Iggy Pritzker added a comment -

        If you are using default image types put this in override folder as ImageType.php

        <?php
        class ImageType extends ImageTypeCore
        {
        public static function getFormatedName($name)

        { $theme_name = Context::getContext()->shop->theme_name; $theme_name ='default'; /* only this line added to call default image type */ $name_without_theme_name = str_replace(array('_'.$theme_name, $theme_name.'_'), '', $name); //check if the theme name is already in $name if yes only return $name if (strstr($name, $theme_name) && self::getByNameNType($name)) return $name; else if (self::getByNameNType($name_without_theme_name.'_'.$theme_name)) return $name_without_theme_name.'_'.$theme_name; else return $theme_name.'_'.$name_without_theme_name; }

        }

        Show
        Iggy Pritzker added a comment - If you are using default image types put this in override folder as ImageType.php <?php class ImageType extends ImageTypeCore { public static function getFormatedName($name) { $theme_name = Context::getContext()->shop->theme_name; $theme_name ='default'; /* only this line added to call default image type */ $name_without_theme_name = str_replace(array('_'.$theme_name, $theme_name.'_'), '', $name); //check if the theme name is already in $name if yes only return $name if (strstr($name, $theme_name) && self::getByNameNType($name)) return $name; else if (self::getByNameNType($name_without_theme_name.'_'.$theme_name)) return $name_without_theme_name.'_'.$theme_name; else return $theme_name.'_'.$name_without_theme_name; } }
        dmetzger made changes -
        Field Original Value New Value
        Assignee Sarah Lorenzini [ slorenzini ]
        Hide
        Sarah Lorenzini added a comment -

        Hi,

        Thanks for your report.
        I don't have this bug on all version of IE. Indeed the size and name images have been changed a lot of time.
        We know that when there is an upgrade version, there is conflict with the "old" images. But it is in improvement.

        Have you always this issue?

        Best regards

        Sarah

        Show
        Sarah Lorenzini added a comment - Hi, Thanks for your report. I don't have this bug on all version of IE. Indeed the size and name images have been changed a lot of time. We know that when there is an upgrade version, there is conflict with the "old" images. But it is in improvement. Have you always this issue? Best regards Sarah
        Sarah Lorenzini made changes -
        Status Open [ 1 ] Need more Infos [ 10000 ]
        Hide
        hsyong hsyong added a comment -

        Sarah,

        This happened to many users. The forum thread is here:
        http://www.prestashop.com/forums/topic/213157-images-not-showing-all-over-the-shop-prestashop-153/

        To reproduce:

        1. Do not use the Default Theme of PS 1.5.3.1. Use a 3rd party theme. Or make a COPY of the default theme and name it as default2 (or something else).

        Keep the admin settings as default (so a new installation of PS 1.5.3.1 with the sample products is better for testing).

        2. Activate the new default2 theme

        3. View in IE9 or 8. The products images will not be displayed because the dimensions are missing from the HTML codes height="" and width="".

        NOTE: The defective HTML code affects ALL browsers. It is just that other browsers will still display the images without height and width... Internet Explorer will not display.

        Show
        hsyong hsyong added a comment - Sarah, This happened to many users. The forum thread is here: http://www.prestashop.com/forums/topic/213157-images-not-showing-all-over-the-shop-prestashop-153/ To reproduce: 1. Do not use the Default Theme of PS 1.5.3.1. Use a 3rd party theme. Or make a COPY of the default theme and name it as default2 (or something else). Keep the admin settings as default (so a new installation of PS 1.5.3.1 with the sample products is better for testing). 2. Activate the new default2 theme 3. View in IE9 or 8. The products images will not be displayed because the dimensions are missing from the HTML codes height="" and width="". NOTE: The defective HTML code affects ALL browsers. It is just that other browsers will still display the images without height and width... Internet Explorer will not display.
        dmetzger made changes -
        Assignee Sarah Lorenzini [ slorenzini ] Vincent AUGAGNEUR [ vaugagneur ]
        dmetzger made changes -
        Assignee Vincent AUGAGNEUR [ vaugagneur ] Sarah Lorenzini [ slorenzini ]
        Sarah Lorenzini made changes -
        Status Need more Infos [ 10000 ] Open [ 1 ]
        Hide
        Sarah Lorenzini added a comment -

        Ok I see that.
        This bug is in improvement. It is not appear if you used the template installer.
        Until yhis, you have to rename the name images by changing the "_default" by your name template like "_nameofyourtemplate" (in your case "_default2".
        IE understand images without width and height.

        Best regards

        Sarah

        Show
        Sarah Lorenzini added a comment - Ok I see that. This bug is in improvement. It is not appear if you used the template installer. Until yhis, you have to rename the name images by changing the "_default" by your name template like "_nameofyourtemplate" (in your case "_default2". IE understand images without width and height. Best regards Sarah
        Sarah Lorenzini made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        Win Suseno added a comment -

        @Sarah,

        IE understand images without width and height ONLY if the attributes width and height are not specified.
        In this case, the attributes width and height are specified but without value.
        Therefore, inept IE naturally gets confused.

        Show
        Win Suseno added a comment - @Sarah, IE understand images without width and height ONLY if the attributes width and height are not specified. In this case, the attributes width and height are specified but without value. Therefore, inept IE naturally gets confused.
        Hide
        Fluring Lifes added a comment -

        This worked for me:

        Deleted the default theme from the backoffice, and renamed the name of my custom template to default.
        I didn't change the folder of my custom template.

        Show
        Fluring Lifes added a comment - This worked for me: Deleted the default theme from the backoffice, and renamed the name of my custom template to default. I didn't change the folder of my custom template.
        Hide
        Maury Markowitz added a comment -

        I just implemented this fix on my 1.5.3.1 server too, but I had to change something. The solution above suggests using...

        return $name_without_theme_name;

        ...but for me I had to use...

        return $name_without_theme_name.'default';

        Maybe that will help someone!

        Show
        Maury Markowitz added a comment - I just implemented this fix on my 1.5.3.1 server too, but I had to change something. The solution above suggests using... return $name_without_theme_name; ...but for me I had to use... return $name_without_theme_name.'default'; Maybe that will help someone!
        Hide
        Maury Markowitz added a comment -

        I believe this same error may cause "add to cart animations" to fail. I am not 100% sure of this, but I did notice they re-appeared when I fixed this problem.

        Show
        Maury Markowitz added a comment - I believe this same error may cause "add to cart animations" to fail. I am not 100% sure of this, but I did notice they re-appeared when I fixed this problem.
        Hide
        Nebojsa Radovic added a comment -

        I have problem with MSIE as well as with Firefox and just using modified default theme. This is quite irritating
        so I would appriciate if someone can check our web and give us some hint how to solve this image issue.

        www.technology-experts.rs

        Show
        Nebojsa Radovic added a comment - I have problem with MSIE as well as with Firefox and just using modified default theme. This is quite irritating so I would appriciate if someone can check our web and give us some hint how to solve this image issue. www.technology-experts.rs
        Show
        shoulders added a comment - this solution works for me http://www.prestashop.com/forums/index.php?/topic/213642-product-images-not-showing-in-ie-after-update-to-1531/page__view__findpost__p__1101141
        Damien Metzger made changes -
        Affected version 1.5.3.0 [ 11890 ] 1.5.3.1 [ 11891 ]

          People

          • Assignee:
            Sarah Lorenzini
            Reporter:
            hsyong hsyong
          • Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: