LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-06-2008, 07:59 AM   #1
waelaltaqi
Member
 
Registered: Sep 2005
Location: USA, TN
Distribution: CentOS & Ubuntu for Desktop
Posts: 454

Rep: Reputation: 31
Embedding GIF into HTML?


How do i embed pictures into HTML? I have a cron job that sends an HTML file and I'm using
Code:
<img src="http://mysite/picture.gif">
to include a picture in the email.

The problem is that when the user recives the email, Thunderbird or outlook will ask whether to download the the picture from the site or not. The picture contains my companies logo and i would like it to show up the moment the user opens the email.

I've seen it done before I've seen some articles about embedding GIF using base64 encoding but i have no clue how to do that...

Anyone can help?

Last edited by waelaltaqi; 02-06-2008 at 08:11 AM.
 
Old 02-06-2008, 08:10 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
that's really none of your business, it's the client taking measures to protect the user irrespective of the file. you shouldn't be able to influence that at all, or that would totally destroy the security measures in the first place.
 
Old 02-06-2008, 08:26 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
((especially important with GIFs since they are a way of embedding malicious code))

Much better to use words and include a link to a website.
 
Old 02-06-2008, 08:40 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
http://www.text-image.com/
 
Old 02-06-2008, 09:45 AM   #5
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
attach the image (base64 encoded) with
Content-ID: <image01.png@FFFFFFFF.FFFFFFFF>
in the html part, reference as source of the image the Content-ID like so: "cid:image01.png@01C8584B.D9F65490"
that will then point to the attachment rather than an external image

i would personally use a png rather than a gif!

@moderators: remove this if you find it inappropriate, as i am sure you would anyway :-)
 
Old 02-06-2008, 09:49 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
but surely any client would block that in exactly the same way..? if it's malicious it's just as malicious there, no?
 
Old 02-06-2008, 09:59 AM   #7
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
it does not look like the clients block the displaying of attached images, but of course it's slightly ugly, as it increases the email size, and also all your emails have an attachment.
i also am not sure what happnes if you simply have a div and add a background image with css to that, would be worth a try.
 
Old 02-07-2008, 10:35 AM   #8
waelaltaqi
Member
 
Registered: Sep 2005
Location: USA, TN
Distribution: CentOS & Ubuntu for Desktop
Posts: 454

Original Poster
Rep: Reputation: 31
I got half of the problem resolved. I was able to convert my companies logo using uuencode then embed it into HTML using base64 encoding. Part of my code looks like this:

Code:
<img src="data:image/gif;base64,R0lGODlh0wFvAOf+AAABBg0PDBIUERYYFhobGR4gHQQc .. >
I get the picture to show up fine with Firefox but not with IE. Now since IE can't then Outlook won't open it either. I've read that IE can't read base64 type encoding without further adjustment to the code. Does using MHTML type docs need completely different code or what... Little frustrated here ... Any ideas on that part?
Thanks in advance.

Last edited by waelaltaqi; 02-07-2008 at 10:37 AM.
 
  


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
locolhost errors to a gif file and not a Html 404 error almost000 Linux - Software 5 06-02-2007 02:22 PM
need shell script to copy 1.gif to 1-100.gif stefaandk Programming 6 03-23-2006 06:20 PM
CMD line tool for PDF -> HTML or JPG/PNG/GIF ilhbutshm Linux - Software 5 10-23-2004 04:18 AM
konqueror displaying raw html. no khtml embedding HriBB Linux - Software 1 06-21-2004 09:16 AM
embedding applications using qt ankitgdit Programming 1 10-26-2003 10:46 AM

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

All times are GMT -5. The time now is 09:40 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