PHP Classes

File: showimage.php

Recommend this page to a friend!
  Classes of Mark de Leon  >  PHP Document Scanner using SANE or eSCL AirPrint  >  showimage.php  >  Download  
File: showimage.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP Document Scanner using SANE or eSCL AirPrint
Web interface to scan printed documents
Author: By
Last change:
Date: 1 year ago
Size: 911 bytes
 

Contents

Class file image Download
<?php
include_once 'phppagestart.php';

$ext = strtolower(pathinfo($image, PATHINFO_EXTENSION));
if (
$ext=='jpg')
{
$mimeext='jpeg';
}
elseif (
$ext=='tif')
{
$mimeext='tiff';
}
else
{
$mimeext=$ext;
}

header("Content-type:image/$mimeext");
$image=$_GET['image'];
$pathimage=$_SESSION['userpath'].$_GET['image'];
header('Content-disposition: inline; filename="'.$image.'"');
header('Content-Transfer-Encoding: binary');
header('Accept-Ranges: bytes');
//Scan20190318010759.jpg
@readfile($pathimage);
//@readfile("/home/kodi/Pictures/scans/Scan20190318010759.jpg");

/*
if ($ext=='jpg')
{
$mimeext='jpeg';
}
else
{
$mimeext=$ext;
}
*/
//header('Content-type: application/jpg');
//$file=$_SESSION[''].$_GET['image'];
//$filename=$_GET['image'];
//$basename = pathinfo($image, PATHINFO_FILENAME);
// $basename= substr($image, 0, -4);
//echo $_SESSION['loggedin'];
//error_reporting(1);
//error_reporting('On');
?>

For more information send a message to info at phpclasses dot org.