Crooker
Crooker

Reputation: 485

writeImage($variable) outputs question mark in filename

So I'm trying to generate few images via imagick operations.

$this->image->writeImage("img/new.jpg");
$this->image->writeImage($location);

This code will write me 2 images, the first one is OK, but the second one ($location is set to img/kopanky.jpg) will create image too, but with name kopanky.jpg?. It doesn't matter how I name it, where I place it, but it happens only when I'm using a variable. The second image looks like the first one, but the question mark in the filename annoys me.

I tried writeImageFile with fopen too.

Upvotes: 2

Views: 211

Answers (1)

huysentruitw
huysentruitw

Reputation: 28111

I'm pretty sure your $location string contains a special character at the end, which is translated to ? on save.

To verify this, add a var_dump($location); to that part of your code and see what's in the string.

Upvotes: 2

Related Questions