From 31f336d69091a21ab3e33ec895ca3ca45abb03ac Mon Sep 17 00:00:00 2001 From: rr- Date: Thu, 28 Jul 2016 19:14:43 +0200 Subject: [PATCH] Added script for fixing image dimensions --- scripts/fix-dimensions | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 scripts/fix-dimensions diff --git a/scripts/fix-dimensions b/scripts/fix-dimensions new file mode 100755 index 00000000..e4645d01 --- /dev/null +++ b/scripts/fix-dimensions @@ -0,0 +1,35 @@ +#!/usr/bin/php +findById($postId); +if (!$post) +{ + echo "Post with this ID was not found in the database."; + return; +} + +$image = $imageConverter->createImageFromBuffer($post->getContent()); +$post->setImageWidth($imageManipulator->getImageWidth($image)); +$post->setImageHeight($imageManipulator->getImageHeight($image)); +$postDao->save($post);