LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-05-2013, 04:48 AM   #1
shqair
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Rep: Reputation: Disabled
Angry .png problem on firefox


hello,,
I have a problem with apache,,
when i tried to open an image (.png) throw the apache on firefox Like this:
(http://localhost/......../framework/images/keyboard.png)
it opened corrupted like this:
( PNG  IHDR 9 PLTE>8PIDATx^Mʱ 7lp{Xhgr,fF`¸w|y՟ņkHNۣyé[c(އ 6zIENDB`)

but on "Internet Explorer" it's opened correctly
what is the probloem ,, is there something must added to httpd.conf !!!
Note: I tried to add this line (AddType image/png png) inside the httpd.conf but Without avail

any help plezz !!!!!!!!!!!!!!!!!!!!!
 
Old 03-05-2013, 05:09 AM   #2
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
Can you not open any .png image or any specific?
because if you are facing this problem for any specific image, open it in GIMP and save again it as .png.
Now try to open it in localhost.
 
Old 03-05-2013, 06:38 AM   #3
shqair
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
hi pavi_kanetkar ,,
I can't open any .png photo from my project inside the "FIREFOX" , but it's opened inside "IE"
BTW ,, there is no problem with other extensions like jpeg, gif ...
 
Old 03-05-2013, 11:48 PM   #4
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
When you inspect the element in firebug, what does it say?
Does it say image not loaded?
Are they background images and you are trying something like this?
Code:
background:url(img/runner1.png) no-repeat;
If these png's are created in photoshop, they might not be opened in chrome and firefox.
Download any png image from google and try with it. Are you facing the same problem?
 
Old 03-06-2013, 01:14 AM   #5
shqair
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
more details about my problem ..
when I put the image inside the ( htdocs dir ) inside the apache the (.jpeg, .png and any extension) opened very good inside firefox and IE ,,
but
when I put the Image in another dir (inside my weblogic) and insert this lines:
<Location /somthing>
SetHandler weblogic-handler
</Location>
inside httpd.conf ,, and tried to open .png it views like this (Š4ŠE€ Ej„"@†"5B €FC‘@HP PF(h(R#h4Š4ŠE€ Ej„"@†"5B) inside firefox but it opened correctly inside IE
 
Old 03-06-2013, 01:36 AM   #6
shqair
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
about "pavi_kanetkar" question (When you inspect the element in firebug, what does it say?)

Error: The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.
Source File: http://localhost/..../images/IMAGE.png

thanx,,
 
Old 03-06-2013, 02:40 AM   #7
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
Check your apache conf file and search following line
Code:
EnableSendfile off
The attribute should be off and it should not be twice entered with different values.
If you make change in conf file, restart the apache.
 
Old 03-06-2013, 03:32 AM   #8
shqair
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
yes ,, it is already off
 
Old 03-06-2013, 04:03 AM   #9
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
As you said the attribute is already off. The message you are getting i.e. "Error: The character encoding of the HTML document was not declared." is generally appeared when the image is corrupt. You will say it is opened fine in IE but for firefox conditions are little different.
As I said before check for different png images.

Have you defined
http-equiv="Content-type" content="text/html; in your project?
 
Old 03-06-2013, 04:38 AM   #10
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
The problem is that Firefox rely on type send in headers, but IE rely on file extension, as you have problems with any png image, then it is most probably problem with sending correct headers. You can install "Tamper data" extension in Firefox to see headers, check what "Content-Type" is sended.

Did you restarted Apache after adding "AddType image/png png"?

Last edited by eSelix; 03-06-2013 at 04:42 AM.
 
Old 03-06-2013, 04:53 AM   #11
shqair
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
really i don't know where can I define "http-equiv..."
coz I call the Image directly from browser "http://localhost/..../images/IMAGE.png" not via a link from page.

BTW ,, I guess there is something wrong between the weblogic and apache because also inside the FIREFOX when I try calling the Image with weblogic port (like this "http://localhost:7001/..../images/IMAGE.png") it works very good ,, and when I copy this Image to "htdocs" inside the apache and call it (like this http://localhost/IMAGE.png") it works very good.
but
when I call the Image (like this "http://localhost/..../images/IMAGE.png") it doesn't work ,,
and when I call another extension (like this "http://localhost/..../images/IMAGE.jpg") it works very good.

I can't explain my problem very well but I hope you understand me
 
Old 03-06-2013, 05:39 AM   #12
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
Yes, I have understood your problem. You can't open png images in firefox if they are inside any project folder in htdocs. If they are put in htdocs outside project folder, you can open them in firefox.
As you have said, your project folder is in htdocs, it means are your using lampp?

Please follow the suggestion once given by 'eSelix' in above comment.
Add following line in your apache conf file and restart apache.
AddType image/png png
 
Old 03-06-2013, 05:59 AM   #13
shqair
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
this is the first thing I done as I said in the first comment "Note: I tried to add this line (AddType image/png png) inside the httpd.conf but Without avail "
 
Old 03-06-2013, 06:13 AM   #14
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
Sorry, I missed the line.
When I found this problem on my apache, I have done the things what I suggested you above and it was solved at my end but they are not working for you.
Can you try <a href anchor tag.
Open a blank file and paste following line in it and save it as png.htm
Code:
 <a href="http://www.epstudiossoftware.com/blog/wp-content/uploads/2011/10/ubuntu_glossy.png">Click here</a> 
<img src="http://www.epstudiossoftware.com/blog/wp-content/uploads/2011/10/ubuntu_glossy.png">
Now put this png.htm in any folder inside htdocs. Suppose the folder is mywebapp.
Now open http://localhost/mywebapp/png.htm
and click on click here.

Paste the output.

Last edited by fortran; 03-06-2013 at 06:34 AM.
 
Old 03-06-2013, 08:59 AM   #15
shqair
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
when I use <img... the Image viewed correctly
but when I use <a href.... and click on the link I have (Š4ŠE€ Ej„"@†"5B €FC‘@HP PF(h(R#h4Š4ŠE€ Ej„"@†"5B)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Incorrect Colours in PNG graphics using Firefox and DVI output DoubleDiode Linux - General 2 05-02-2011 11:28 AM
cannot see png images in firefox BCarey Slackware 11 04-26-2009 08:29 PM
firefox and .png images. slackbat Slackware 9 12-02-2005 09:22 AM
Webalizer: configure: error: png library not found... please install png. mikeshn Linux - Software 5 01-10-2005 02:28 PM
Where is trashcan_full/empty.png and kmenu.png??? d33pdream Linux - General 2 02-25-2003 11:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration