Revathi's avatar

Get image properties in laravel

Hi, I am using laravel 5.8. I want to get description, title, tag and other properties from uploaded image. How I get this.

0 likes
7 replies
bugsysha's avatar

Have you tried ImageMagick? Or are you looking for a library?

Revathi's avatar

I tried ImageMagick in normal php it shows an error - Fatal error: Uncaught ImagickException: UnableToOpenBlob `test.jpg': No such file or directory @ error/blob.c/OpenBlob/2702 in

himanshurajvanshi's avatar

@revathi are you storing those details into database then you can get details base on id or base on image name also. IF you need anythink else then give more details.

$data=ModelName::where('id',1)->get();

Revathi's avatar

No, I didn't store database. First Image files directly moved to our folder through FTP. After that we need to run cron or some url to fetch the particular folder images and these properties should be store in the database. It is a difficult one.

bugsysha's avatar

But it tells you what the problem is:

No such file or directory

You are not providing correct file path to ImageMagick. Fix that and you can continue to live happily ever after 😂

Revathi's avatar

Ok But I have an Image in this folder

bugsysha's avatar

Unless you've used something like __DIR__ to prefix ImageMagick does not know your current working dir. And if it knew then it would throw something like:

Fatal error: Uncaught ImagickException: UnableToOpenBlob `some/path/to/file/test.jpg': No such file or directory

Instead of just saying test.jpg.

Please or to participate in this conversation.