Reputation: 173
I am creating an image using the code below:
http://php.net/manual/en/function.imagecreatefromjpeg.php.
Now, I displayed the image in my webpage, localhost/home.php and fetched the image in here.
<img src="<?php echo http://localhost/imagecreate.php; ?>" />
and displayed correctly.
However, my problem is that, it takes time to load the website because of that imagecreate script unlike with the usual image below:
<img src="images/img.jpg" />
Is there any other way to load the imagecreatefromjpeg faster?
Upvotes: 2
Views: 1433
Reputation: 9979
You are dynamically creating an image every time. So the caching won't work. That's why it's taking more time to load. Better convert the image while uploading, to desired format and save it. Then load image directly without imagecreate.
Upvotes: 1