[TASK] Allow compressing of images with special characters#5
[TASK] Allow compressing of images with special characters#5andreash-b13 wants to merge 1 commit intob13:masterfrom
Conversation
| if ($file instanceof \Schmitzal\Tinyimg\Domain\Model\File) { | ||
| $file = $this->resourceFactory->getFileObject($file->getUid()); | ||
| if (filesize(GeneralUtility::getFileAbsFileName($file->getPublicUrl())) > 0) { | ||
| if (filesize(GeneralUtility::getFileAbsFileName(urldecode($file->getPublicUrl()))) > 0) { |
There was a problem hiding this comment.
hm, ich weiss nicht ob das so cool ist, ich denke mal $file->getPublicUrl()encoded die url, und dann wird sie hier wieder decoded, gibts da nicht evtl. eine andere Methode, den den Pfad uncodiert zurückgibt?
There was a problem hiding this comment.
Fand ich auch schön, wenn es da eine gibt. Kennst du eine?
There was a problem hiding this comment.
Jo also der macht das ziemlich früh im core. Ich müsste mir halt stattdessen die URL selbst zusammen bauen aus identifier und storage (hier fileadmin). Was meinst du ist besser?
| $fileSize = $this->pushToTinyPngAndStoreToCdn($file); | ||
| } else { | ||
| $publicUrl = PATH_site . $file->getPublicUrl(); | ||
| $publicUrl = PATH_site . urldecode($file->getPublicUrl()); |
| $source = \Tinify\fromFile($publicUrl); | ||
| $source->toFile($publicUrl); | ||
|
|
||
| // Sanitize URL in order to check if there are any special characters. |
There was a problem hiding this comment.
mh, sollte das nicht schon vorher passiert sein? ich finde das gehört hier nicht hier, dass der CompressImageService das file umbennt, das müsste anders gehen
There was a problem hiding this comment.
Was schwebt dir da denn vor?
There was a problem hiding this comment.
das kommt ja nur vor, wenn Du das Convert-Command über CLI ausführst, und die Datei, ist noch nicht "richtig" umbenannt, oder? Evtl. kannst Du ein weiteres Command bauen, welches Dateien richtig umbennt? (evtl. auch unabh. von dieser Extension?)
No description provided.