On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • I am working on a shop that sells hair care product and I made the image in png so that the product is cutout the background the background is transparent but when I upload the image using maxigallery the thumb and image loses the background transparency and gets gray.

    is there an option to preserve the transparency in png’s?

    Dimmy
      follow me on twitter: @dimmy01
    • Are you sure it’s not just a browser-problem? More specifically, IE has problems displaying transp. PNGs (well, at least up to IE6, not sure about IE7). Did you check it with Firefox?
      • Quote from: ganeshXL at May 18, 2007, 02:36 PM

        Are you sure it’s not just a browser-problem? More specifically, IE has problems displaying transp. PNGs (well, at least up to IE6, not sure about IE7). Did you check it with Firefox?

        I work on an IMac using Firefox 2.0.0.3, thats not the problem

        I will attach 2 images here the original and the generated version.
          follow me on twitter: @dimmy01
        • It depends how PNGs are handled in MaxiGallery, then... These are 2 functions responsible for PNG-handling in PHP:

          http://ch2.php.net/manual/en/function.imagecreatefrompng.php
          http://ch2.php.net/manual/en/function.imagesavealpha.php

          Maybe go through the snippet and check whether alpha actually is being preserved or not. If they are, maybe your php-config doesn’t support these functions (e.g. old GD-library).
          • I could not find the solution, If somone could help me with this that would be great.
              follow me on twitter: @dimmy01
            • See the Thumbnail.class.php in the watermark folder. The imagesavealpha is used in one function that are not used by the class. You could modify the class so that the alpha is saved. I don’t know why it isn’t saved by default, I haven’t done any (major) modifications to the class. It could be that it’s not supported in all server environments or is slow to do or something and that’s why it isn’t done by default.


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • I know this topic is as old as the hills but I can’t find any solution to this in the forum... I’ve having the exact same issue. If I upload a transparent PNG through Maxigalleryit’s losing the transparency, however if I upload and overwrite the image on my host, the transparency is how it should be.

                Forgive me if this is answered somewhere but I can’t find it using the search.

                Thanks, Ross
                  Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                  AugmentBLU - MODX Partner

                  BLUcart - MODX Revolution E-Commerce & Shopping Cart
                • I guess no one has tried changing that Thumbnail.class.php or just hasn’t reported back. You can try that.

                  EDIT: Or another option is to make MaxiGallery to save the original picture unchanged and use phx:phpThumb modifier in MaxiGallery templates to make phpThumb to do the different size images for display. phpThumb can handle png transparency by default I think.


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."