But I want to generate a custom Twitter card based on my products images. First I tried using PHP with GD library to open a “background” image and the product image that the visitor is currently watching, and the idea is to generate a final png with the composite of both images. The code had no errors but I still wasn’t able to generate the final image because I got a 403 Forbidden error each time I tried to read the product image with PHP.
But the canvas element doesn’t allow me to use the function toDataURL() for security reasons, so I’m not able to capture the source of the resulting image and assign it to the Twitter card code. So, I’m back to square one.
So, the question is: Do I have any way to load the image from PHP so I’m able to generate the image as I want? Maybe using http authentication or anything?