Created
July 23, 2014 08:57
-
-
Save putzflorian/f6fc71f4a04a2c68b54c to your computer and use it in GitHub Desktop.
Pimcore_Image Create temp Images
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $tmpFiles = []; | |
| foreach ($_FILES as $file) { | |
| $imPath = PIMCORE_TEMPORARY_DIRECTORY . "/" . uniqid() . ".jpg"; | |
| $im = Pimcore_Image::getInstance(); | |
| $im->load($file["tmp_name"]); | |
| // $im->load("http://asdsadasd/test.jpg"); | |
| $im->scaleByWidth(1000); | |
| $im->save($imPath, "JPEG", 80); | |
| $tmpFiles[] = $imPath; | |
| } | |
| // senden | |
| foreach($tmpFiles as $i) { | |
| unlink($i); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment