Skip to content
Advertisement

mime_content_type(): Invalid path

I am creating a picture with text on it like this:

createImage.php

JavaScript

Result

To actually show the created image in html, I use this:

JavaScript

The functionality itself is working fine and the result looks like this – which is how it is supposed to look:

enter image description here

Problem

The problem is that I get the following warning:

Warning: mime_content_type(): Invalid path in createImage.php on line 19

I don’t really know what’s wrong with the path.

What is the problem here?

Advertisement

Answer

mime_content_type requires path to the tested file, not just base64 string. But why are you trying to recognize mime type when you know it is image/jpeg (by imagejpeg function).

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement