0

I have a php file that generates an image based on some parameters. But it doesn't seem like CE Image knows how to handle that.

The URL looks something like this: myimg.php?id=165

It's being served as an image: header('Content-Type: image/jpeg');

When viewing it in the browser it shows the image like it's supposed to. It also works with the <img>-tag, so there's nothing wrong with the image.

1

Since the source that is being passed into CE Image is not an actual image on the file system, you'll want CE Image to treat it as a remote image. You can accomplish that by using the parameter force_remote="y".

Here's an example:

{exp:ce_img:singe src="http://example.com/myimg.php?id=165" width="100" force_remote="y"}
| improve this answer | |
  • I'm only getting an error message: CE Image debug: Unknown image format. – peirix Aug 11 '14 at 17:34
  • Do you have any examples of this working? With a corresponding php-file? Right now I'm outputting a base 64-encoded bytearray $img = base64_encode($something[$idFromUrl]); echo $img; – peirix Aug 13 '14 at 12:55
  • Oh, wow, I totally messed up. I'm working on localhost, which of course doesn't work with force_remote. It works when I publish it. Thanks! – peirix Aug 13 '14 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.