I seem to be getting a corruption when I email an in-line embedded GIF.
Here is the original file that was uploaded via my web app, it saved correctly and displays on the web page absolutely fine....
When a new banner is added to the system, a copy of the banner is sent to certain employees as a notification that the banner is live along with details of clickthrough tracking, expiry date of the advert , location on the extranet etc..
I have added several JPG / PNG static files without problems and the email received displays them fine, however the above image is appearing in the email as follows...
And as you can see all the animation is also missing.
Why is this happening?
I'm reading the file using
Which is passed to the emailing module that performs the MIME::Lite method...
And then marked up in the email like so...
The image is only 95kb in size so it can't be a size issue, it also appears to always happen when ever I use a GIF image regardless of it containing animation or just being a static GIF.
Something I am doing must be corrupting the image information somehow?
Your advise is very much appreciated.
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
Here is the original file that was uploaded via my web app, it saved correctly and displays on the web page absolutely fine....
When a new banner is added to the system, a copy of the banner is sent to certain employees as a notification that the banner is live along with details of clickthrough tracking, expiry date of the advert , location on the extranet etc..
I have added several JPG / PNG static files without problems and the email received displays them fine, however the above image is appearing in the email as follows...
And as you can see all the animation is also missing.
Why is this happening?
I'm reading the file using
Code:
# read image file to raw binary and set for result
local $/ = undef;
open (my $img, '/images/banners/' . $banner[0]{'Page'} . '_' . $banner[0]{'RecID'} . '.' . $banner[0]{'Ext'}) or die $!;
binmode $img;
$result->{data}->{raw} = <$img>;
close $img;
Which is passed to the emailing module that performs the MIME::Lite method...
Code:
$msg->attach(
Encoding => 'base64',
Type => 'image/' . $img->{ext},
Data => $img->{raw},
Id => $img->{id},
Disposition => 'inline'
);
And then marked up in the email like so...
Code:
<img src="cid:<tmpl_var name='img'>" title="<tmpl_var name='tooltip'>" alt="<tmpl_var name='tooltip'>" />
The image is only 95kb in size so it can't be a size issue, it also appears to always happen when ever I use a GIF image regardless of it containing animation or just being a static GIF.
Something I am doing must be corrupting the image information somehow?
Your advise is very much appreciated.
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music