Ticket #2413: fax-process.pl.patch

File fax-process.pl.patch, 1.4 kB (added by splante, 8 months ago)

Patch file for fax-process.pl (Against Core 2.4.0.1)

  • fax-process.pl

    old new  
    102102$attachment = $file unless ($attachment); 
    103103 
    104104my $encoded=""; 
     105my $enc_gif=""; 
    105106my $buf=""; 
    106107# First, lets find out if it's a TIFF file 
    107108read(FILE, $buf, 4); 
     
    115116                $encoded .= encode_base64($buf); 
    116117        } 
    117118        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; 
    118126} else { 
    119127        # It's a PDF already 
    120128        # Go back to the start of the file, and start again 
     
    138146foreach (0..16) { $boundary .= $chrs[rand (scalar @chrs)]; }  
    139147 
    140148my $len = length $encoded; 
     149my $len_gif = length $enc_gif; 
    141150# message body.. 
    142151my $msg ="Content-Class: urn:content-classes:message 
    143152Content-Transfer-Encoding: 7bit 
     
    156165Content-Type: text/plain; charset=\"us-ascii\" 
    157166Content-Transfer-Encoding: quoted-printable 
    158167 
    159 A Fax has been recieved by the fax gateway, and is attached to this message. 
     168A Fax has been received by the fax gateway, and is attached to this message. 
    160169 
    161170 
    162171--$boundary 
     172Content-Type: image/gif; name=\"thumb.gif\" 
     173Content-Transfer-Encoding: base64 
     174 
     175$enc_gif  
     176--$boundary 
    163177Content-Type: $ct; name=\"$attachment\" 
    164178Content-Transfer-Encoding: base64 
    165179Content-Disposition: attachment; filename=\"$attachment\" 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads