0

I'm experiencing an error while saving an image with my imagejpeg() function.

$tempFile = 'temp/'.$fbme['id'].'.jpg';
imagejpeg($cardImg,$tempFile,90);
saveTrackingRecord($fbme['id'], $randomPicIdx);

This is the error:

Warning: imagejpeg() expects parameter 1 to be resource, boolean given

Please help. Thank you so much in advance.

Update

Here is how I initially defined $tempfile.

$tempFile = 'temp/'.$fbme['id'].'.jpg?time='.time();

Here is how I am giving o/p:

<img src="<?php echo $tempFile.'?time='.time(); ?>" style="width:90%; max-width:400px;"/></center><br/>
I wrestled a bear once.
  • 22,983
  • 19
  • 69
  • 116
Shiva
  • 369
  • 2
  • 3
  • 12

1 Answers1

0

You need to create the image with imagetruecolor before passing it to the function imagejpeg

SpongePablo
  • 870
  • 10
  • 24