Ticket #2413: fax-process.pl.patch
| File fax-process.pl.patch, 1.4 kB (added by splante, 8 months ago) |
|---|
-
fax-process.pl
old new 102 102 $attachment = $file unless ($attachment); 103 103 104 104 my $encoded=""; 105 my $enc_gif=""; 105 106 my $buf=""; 106 107 # First, lets find out if it's a TIFF file 107 108 read(FILE, $buf, 4); … … 115 116 $encoded .= encode_base64($buf); 116 117 } 117 118 close PDF; 119 120 open GIF, "convert -resize '50%' -monochrome -delay 300 ${file}[0,1] gif:- |"; 121 $buf = ""; 122 while (read(GIF, $buf, 60*57)) { 123 $enc_gif .= encode_base64($buf); 124 } 125 close GIF; 118 126 } else { 119 127 # It's a PDF already 120 128 # Go back to the start of the file, and start again … … 138 146 foreach (0..16) { $boundary .= $chrs[rand (scalar @chrs)]; } 139 147 140 148 my $len = length $encoded; 149 my $len_gif = length $enc_gif; 141 150 # message body.. 142 151 my $msg ="Content-Class: urn:content-classes:message 143 152 Content-Transfer-Encoding: 7bit … … 156 165 Content-Type: text/plain; charset=\"us-ascii\" 157 166 Content-Transfer-Encoding: quoted-printable 158 167 159 A Fax has been rec ieved by the fax gateway, and is attached to this message.168 A Fax has been received by the fax gateway, and is attached to this message. 160 169 161 170 162 171 --$boundary 172 Content-Type: image/gif; name=\"thumb.gif\" 173 Content-Transfer-Encoding: base64 174 175 $enc_gif 176 --$boundary 163 177 Content-Type: $ct; name=\"$attachment\" 164 178 Content-Transfer-Encoding: base64 165 179 Content-Disposition: attachment; filename=\"$attachment\"
