Jump to content

imageCreateFromJPEG error


greengo

Recommended Posts

I've used this with success in another project

 

$image = imagecreatefromjpeg("FSESig.jpg");

 

 

So I would try a couple of things.  One, get rid of the @ so you can see if there are any other errors.

Two, get rid of the space before $dir

Three, try an absolute path or a jpg that is in the same folder.

this's the function  :)

 

<?php

function createFile($dir_photo)

{

$dir = opendir($dir_photo);

 

//List files in images directory

while (($file = readdir($dir)) !== false)

{

  $ext = substr($file,strlen($file)-3);

  $ext = strtolower($ext);

  if($ext=="jpg")

  {

  $img = @imagecreatefromjpeg( $dir_photo.$file )or die ( E_ERROR ());

  $width = ImageSX($img);

  $height = ImageSY( $img );

  echo $width."-".$height;

  //echo $dir_photo.$file."</br>";

  }

}

}

createFile("photo/");

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.