png image support

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
loub0999
Posts: 28
Joined: Sun 10. Dec 2006, 04:27
Location: Montreal, Quebec, Canada
Contact:

png image support

Post by loub0999 »

I'm trying to integrate images into my design that are .png format but when I upload them to the server with phpWCMS v1.2.8, the application converts the transparent layer to black. I don't want to use .gif because of the limited color palet. I want my photos to look the best they can.

Is there a way to upload them so they don't become corrupt? Is this because the phpWCMS application doesn't support .png format? Is there an easy fix?
Last edited by loub0999 on Sun 14. Jan 2007, 15:20, edited 2 times in total.
The only limits that exist, are those we impose on ourselves!
-me
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Post by update »

Why don't you just ftp them and build them into your page using the fckeditor? This way they won't be handled by phpwcms/gd/imagemagick I think - and are just what they are: fine pictures...
claus
loub0999
Posts: 28
Joined: Sun 10. Dec 2006, 04:27
Location: Montreal, Quebec, Canada
Contact:

figured out how to activate fckeditor...

Post by loub0999 »

It took me over 30 minutes to figure out how to activate fckeditor, wysiwyg editor is off by default. Now I can't create a folder to upload to, permission denied! If I login with FIlezilla ftp client and create a folder from that software, where do I place the image folder so that fckeditor can see it? I tried the pictures folder in my phpwcms installation, to no avail...

Or how do I fix permissions for fckeditor, so that it will stop giving me error messages?

I just get blank pages when I try to open files on the server from fckeditor:
Image

And I get this dialog when I try to create a folder:
Image

And nothing happens when I click on upload, even though it says upload successfully, I never get an image in the fckeditor image browser. :(
The only limits that exist, are those we impose on ourselves!
-me
loub0999
Posts: 28
Joined: Sun 10. Dec 2006, 04:27
Location: Montreal, Quebec, Canada
Contact:

Switched to SPAW

Post by loub0999 »

I changed the WYSIWYG editor to SPAW and it spits out error messages in a very high level of detail, it gives the URL of the folder it is trying to upload to and says the permissions are incorrect! :P

So I just changed the permissions to 777 on that folder and SPAW is working, my .png images are working! Life could not be better!

Take a look, it's the house mask with a photograph inside of it in the top right hand side of the header.

http://www.firsttimesellers.com/phpWCMS/index.php?index

Thanks for your advice! 8)
The only limits that exist, are those we impose on ourselves!
-me
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Post by update »

have a look at the page with IE, please - the image is showing for some second while revealing the typical dirty-grey IE substitute for transparency and then it is vanishing again.
This probably neans that in your conf file you'll have to activate the line talking about "pngbehavior" - check it out
And

Code: Select all

<!--[if lt IE 7]>
<script language="JavaScript">
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }    
}
window.attachEvent("onload", correctPNG);
</script>
is obviously intended to do the same - did you put this into your code or where it is coming from? Is it a substitute for the built-in

Code: Select all

  <!--[if lt IE 7]>
  <style type="text/css">
    body { behavior: url("phpwcms_template/inc_css/specific/csshover2.htc"); }
    img { behavior: url("phpwcms_template/inc_css/specific/pngbehavior.htc"); }
  </style>
  <![endif]-->
This seems to become a double whopper :wink:
And Originally then there is a line saying

Code: Select all

<!--[if lte IE 7]>
    <style type="text/css">@import url(phpwcms_template/inc_css/specific/ie_only.css);</style>
  <![endif]-->
for steering your ie via css
-where is it gone to?
OK, so far
greetings
claus
loub0999
Posts: 28
Joined: Sun 10. Dec 2006, 04:27
Location: Montreal, Quebec, Canada
Contact:

phpwcms version 1.2.8 contains png fix for IE?

Post by loub0999 »

I put this code there myself. When I looked at the site with other browsers, I noticed that IE v6 didn't support png format. (that ugly gray substitute instead of transparent). So I did some hunting arround the Internet to find a fix, I don't know how to program, code looks like chineese to me! ;)

I had notided that IE v6 loaded the png twice, but found that putting in this code in place and having IE act funny was better than no png support.

I did all this before updating to phpWCMS v1.2.8.

I tried removing my code and previewed my page in Internet Explorer, it doesn't show the png file at all now! Actually it loads it once with that gey layer, then it dissapears! Are you talking about line 87 in conf.inc.php?

Code: Select all

$phpwcms['IE_htc_png'] = 1; // enables HTC pngbehavior for IE < 7 - has no effect in other browsers
as you can see it is set to 1 which means "on" right? So why isn't IE displaying the png? Is there a bug in phpWCMS?

BTW, thanks for your help! :)

P.S.: I think I should mention that in order to preview my site in Internet Explorer, I have to run a Virtual PC session I downloaded from Microsoft. Windows doesn't allow multiple versions of IE on the same machine, and since I always install all of the system patches, I am now running IE7 on my machine. Being a consciencious designer, I try to preview my sites in as many versions of all the major browsers, to see that all is ok.

On a Mac I can install as many version of IE as I like, but not in Windows unfortunately.

All this said, with my code IEv6 in Virtual PC session displays the png, but not with the phpwcms local code though.
The only limits that exist, are those we impose on ourselves!
-me
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Post by update »

sorry! I indeed forgot to mention that my writings were related to version 1.28
Perhaps you'd like to check my posting related to this topic too..
claus
Post Reply