Created
January 8, 2015 20:55
-
-
Save sandosh/9e7014ad5057fe2a765f to your computer and use it in GitHub Desktop.
This file contains 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
diff --git a/app/config/config.yml b/app/config/config.yml | |
index 74b1729..22a1f94 100644 | |
--- a/app/config/config.yml | |
+++ b/app/config/config.yml | |
@@ -246,21 +246,21 @@ ano_media: | |
user_image: | |
provider: local | |
formats: | |
- small: { width: 50, height: 50 } | |
- medium: { width: 100, height: 100 } | |
- large: { width: 400, height: 400 } | |
+ small: { width: 50, height: 50, quality: %media.quality% } | |
+ medium: { width: 100, height: 100, quality: %media.quality% } | |
+ large: { width: 400, height: 400, quality: %media.quality% } | |
inspiration_image: | |
provider: local | |
formats: | |
- small: { height: 300 } | |
+ small: { height: 300, quality: %media.quality% } | |
before_image: | |
provider: local | |
formats: | |
- small: { height: 300 } | |
+ small: { height: 300, quality: %media.quality% } | |
moodboard_image: | |
provider: local | |
formats: | |
- small: { width: 200, height: 200 } | |
+ small: { width: 200, height: 200, quality: %media.quality% } | |
sidebyside_image: | |
provider: local | |
formats: | |
@@ -270,20 +270,20 @@ ano_media: | |
offer_image: | |
provider: local | |
formats: | |
- small: { width: 150 } | |
- medium: { width: 400 } | |
+ small: { width: 150, quality: %media.quality% } | |
+ medium: { width: 400, quality: %media.quality% } | |
press_file: | |
provider: local | |
formats: | |
press_icon: | |
provider: local | |
formats: | |
- small: { width: 120 } | |
+ small: { width: 120, quality: %media.quality% } | |
blog_post_image: | |
provider: local | |
formats: | |
- medium: { width: 420 } | |
- large: { width: 1280 } | |
+ medium: { width: 420, quality: %media.quality% } | |
+ large: { width: 1280, quality: %media.quality% } | |
tbbc_rest_util: | |
error: | |
diff --git a/app/config/security.yml b/app/config/security.yml | |
index 1fb5e34..72ef8c6 100644 | |
--- a/app/config/security.yml | |
+++ b/app/config/security.yml | |
@@ -51,7 +51,7 @@ security: | |
provider: my_fos_facebook_provider | |
anonymous: true | |
remember_me: | |
- key: "%secret%" | |
+ key: %secret% | |
lifetime: 604800 | |
path: home | |
domain: ~ | |
diff --git a/src/Nous/NotificationsBundle/Resources/config/listener.xml b/src/Nous/NotificationsBundle/Resources/config/listener.xml | |
index 09d191b..c1ae342 100644 | |
--- a/src/Nous/NotificationsBundle/Resources/config/listener.xml | |
+++ b/src/Nous/NotificationsBundle/Resources/config/listener.xml | |
@@ -14,7 +14,7 @@ | |
<tag name="kernel.event_listener" event="fos_user.registration.confirmed" method="onRegistrationConfirmed"/> | |
<tag name="kernel.event_listener" event="nous.facebook.registration" method="onFacebookRegistration"/> | |
<tag name="kernel.event_listener" event="nous.facebook.registration.confirmed" method="onRegistrationConfirmed"/> | |
- <tag name="kernel.event_listener" event="nous.project.post" method="onProjectPost"/> | |
+ <tag name="kernel.event_listener" event="nous.project.activate" method="onProjectPost"/> | |
<tag name="kernel.event_listener" event="nous.project.comment" method="onProjectComment"/> | |
<tag name="kernel.event_listener" event="nous.application.post" method="onApplicationPost"/> | |
<argument type="service" id="email_notification.service" /> | |
diff --git a/src/Nous/SiteBundle/Media/Util/Image/ImagineImageManipulator.php b/src/Nous/SiteBundle/Media/Util/Image/ImagineImageManipulator.php | |
index 654286e..ecc0a32 100644 | |
--- a/src/Nous/SiteBundle/Media/Util/Image/ImagineImageManipulator.php | |
+++ b/src/Nous/SiteBundle/Media/Util/Image/ImagineImageManipulator.php | |
@@ -173,7 +173,7 @@ class ImagineImageManipulator extends BaseManipulator | |
} | |
$tmpfname = tempnam("/tmp", "TEMP_IMAGE_" . rand()); | |
- file_put_contents($tmpfname, $image->get('jpg')); | |
+ file_put_contents($tmpfname, $image->get('jpg', $this->getCompressionOptions())); | |
$moodboardImage = new MoodboardImage(); | |
$moodboardImage->setName('moodboardImage'); | |
@@ -207,7 +207,7 @@ class ImagineImageManipulator extends BaseManipulator | |
; | |
$tmpfnameSmall = tempnam("/tmp", "TEMP_SIDEBYSIDE_IMAGE_" . rand()); | |
- file_put_contents($tmpfnameSmall, $sideBySideBox->get('jpg')); | |
+ file_put_contents($tmpfnameSmall, $sideBySideBox->get('jpg', $this->getCompressionOptions())); | |
// Vertical | |
@@ -224,13 +224,13 @@ class ImagineImageManipulator extends BaseManipulator | |
; | |
$tmpfname = tempnam("/tmp", "TEMP_VERTICAL_IMAGE_" . rand()); | |
- file_put_contents($tmpfname, $verticalBox->get('jpg')); | |
+ file_put_contents($tmpfname, $verticalBox->get('jpg', $this->getCompressionOptions())); | |
} else { | |
$tmpfnameSmall = tempnam("/tmp", "TEMP_SIDEBYSIDE_IMAGE_" . rand()); | |
- file_put_contents($tmpfnameSmall, $image->get('jpg')); | |
+ file_put_contents($tmpfnameSmall, $image->get('jpg', $this->getCompressionOptions())); | |
$tmpfname = tempnam("/tmp", "TEMP_VERTICAL_IMAGE_" . rand()); | |
- file_put_contents($tmpfname, $image->get('jpg')); | |
+ file_put_contents($tmpfname, $image->get('jpg', $this->getCompressionOptions())); | |
} | |
$sideBySideImage = new SideBySideImage(); | |
@@ -271,10 +271,10 @@ class ImagineImageManipulator extends BaseManipulator | |
; | |
$tmpfname = tempnam("/tmp", "TEMP_VERTICAL_IMAGE_" . rand()); | |
- file_put_contents($tmpfname, $verticalBox->get('jpg')); | |
+ file_put_contents($tmpfname, $verticalBox->get('jpg', $this->getCompressionOptions())); | |
} else { | |
$tmpfname = tempnam("/tmp", "TEMP_VERTICAL_IMAGE_" . rand()); | |
- file_put_contents($tmpfname, $image->get('jpg')); | |
+ file_put_contents($tmpfname, $image->get('jpg', $this->getCompressionOptions())); | |
} | |
$verticalImage = new VerticalImage(); | |
@@ -285,4 +285,9 @@ class ImagineImageManipulator extends BaseManipulator | |
return $moodboard; | |
} | |
+ | |
+ private function getCompressionOptions() | |
+ { | |
+ return array('jpeg_quality' => 10); | |
+ } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment