Skip to content

Commit

Permalink
missed a spot+fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GM-Script-Writer-62850 committed Jul 5, 2013
1 parent edd0173 commit 0012417
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
21 changes: 9 additions & 12 deletions download.php
Expand Up @@ -102,16 +102,14 @@ function returnFile($in,$out,$ext){
$pdf->MultiCell(0,5,file_get_contents("scans/".$_GET['file']),0,"L",false);
}
else{
$image=explode("x",shell_exec("identify -format '%wx%h' \"scans/".$_GET['file']."\""));
$image=explode("x",shell_exec("identify -format '%wx%h' \"scans/".addslashes($_GET['file'])."\""));
$width=$width-($marginLeft*2);
$height=$height-$marginTop*2-$fontSize*0.75;
$pWidth=$width/100;
$pHeight=$height/100;

if($pHeight-$pWidth<=$image[0]/100-$image[1]/100)
$height=0;
else
if($height/$width<=$image[1]/$image[0])
$width=0;
else
$height=0;
$pdf->Image('scans/'.$_GET['file'],$marginLeft,$marginTop/2+$fontSize,$width,$height);
}
$pdf->Output(substr($_GET['file'],0,strlen($ext)*-1)."pdf",'D');
Expand All @@ -132,14 +130,13 @@ function returnFile($in,$out,$ext){
$pdf->MultiCell(0,5,file_get_contents("scans/".$_GET['file']),0,"L",false);
}
else{
$image=explode("x",shell_exec("identify -format '%wx%h' \"scans/".$_GET['file']."\""));
$pWidth=$width/100;
$pHeight=$height/100;
$image=explode("x",shell_exec("identify -format '%wx%h' \"scans/".addslashes($_GET['file'])."\""));

if($pHeight-$pWidth<=$image[0]/100-$image[1]/100)
$height=0;
else
if($height/$width<=$image[1]/$image[0])
$width=0;
else
$height=0;

$pdf->Image('scans/'.$_GET['file'],$marginLeft,$marginTop,$width,$height);
}
$pdf->Output(substr($_GET['file'],0,strlen($ext)*-1)."pdf",'D');
Expand Down
8 changes: 4 additions & 4 deletions inc/edit.php
Expand Up @@ -14,10 +14,10 @@
</div>
<div class="control">
<select name="filetype" onchange="fileChange(this.value)">
<option value="png">*.png</option>
<option value="jpg">*.jpg</option>
<option value="tiff">*.tiff</option>
<option value="txt">*.txt</option>
<option value="png">Portable Network Graphic: *.png</option>
<option value="jpg">Joint Photography Group: *.jpg</option>
<option value="tiff">Tagged Image File Format: *.tiff</option>
<option value="txt">Text File: *.txt</option>
</select>
<script type="text/javascript">document.scanning.filetype.value='<?php echo substr($file,strrpos($file,'.')+1); ?>';</script>
</div>
Expand Down
8 changes: 8 additions & 0 deletions inc/style.php
Expand Up @@ -176,6 +176,14 @@
border-radius: 5px 5px 0 0;
}

.tab a {
display: inline-block;
max-width: 175px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.tab div {
display: none;
}
Expand Down

0 comments on commit 0012417

Please sign in to comment.