I use LiipImagineBundle for re-size my image after upload. I have a error when I tried to upload some Jpeg about HTML encodage.
With jpeg form my camera that's work, but not form my phone camera.
What my browser show only js error and return blank page ?
I didn't understand what is that error.
Full message in french :
L'encodage de caractères du document HTML n'a pas été déclaré. Le document sera affiché avec des caractères incorrects pour certaines configurations de navigateur si le document contient des caractères en dehors de la plage US-ASCII. L'encodage de caractères de la page doit être déclaré dans le document ou dans le protocole de transfert.
controller Symfony2
private function compressFile($file) {
$path = $file->getWebPath();
$absPath = $file->getAbsolutePath();
$tmpPath = $absPath."tmp";
$filter = "image";
$container = $this->container;
$dataManager = $container->get('liip_imagine.data.manager');
$filterManager = $container->get('liip_imagine.filter.manager');
try {
$image = $dataManager->find($filter, $path);
$response = $filterManager->applyFilter($image, $filter);
//$response = $filterManager->get($this->getRequest(), $filter, $image, $path);
$fileCompressed = $response->getContent();
}
catch (\Exception $e) {
return "error";
}
$f = fopen($tmpPath, 'w');
fwrite($f, $fileCompressed);
fclose($f);
unlink($absPath);
rename($tmpPath, $absPath);
return null;
}
I have found help to create my compress Function here.
I tried to catch some Exception but nothing work.
Someone have a solution ?
Sorry for my English, I am learning it...