Permalink
Browse files

Fixed jqueryimage

  • Loading branch information...
1 parent b6470b1 commit c02184b3703cb01c2ea62865355298cd130d381e @genemu genemu committed Jan 6, 2012
@@ -46,7 +46,7 @@ public function uploadAction(Request $request)
'file' => ''
);
- if (true === preg_match('/image/', $handle->getMimeType())) {
+ if (0 === strpos($handle->getMimeType(), 'image')) {
$handle = new Image($handle->getPathname());
$thumbnail = $handle;
@@ -239,18 +239,16 @@ private function addImage(ArrayNodeDefinition $rootNode)
->children()
->booleanNode('enabled')->defaultTrue()->end()
->scalarNode('selected')->defaultValue('large')->end()
- ->arrayNode('filters')
+ ->variableNode('filters')
->defaultValue(array('rotate', 'bw', 'negative', 'sepia', 'crop'))
- ->prototype('scalar')->end()
->end()
- ->arrayNode('thumbnails')
+ ->variableNode('thumbnails')
->defaultValue(array(
'small' => array(100, 100),
'medium' => array(200, 200),
'large' => array(500, 500),
'extra' => array(1024, 768)
))
- ->prototype('scalar')->end()
->end()
->end()
->end()
@@ -191,6 +191,10 @@ private function registerImageConfiguration(array $configs, ContainerBuilder $co
throw new \LogicException('Your selected thumbnail does not empty.');
}
+ if (false === isset($configs['thumbnails']) && false === is_array($configs['thumbnails'])) {
+ throw new \LogicException('Option image.thumbnails does not array.');
+ }
+
if (false === isset($configs['thumbnails'][$configs['selected']])) {
throw new \LogicException(sprintf('Your selected %s is not thumbnail.', $configs['selected']));
}
@@ -86,8 +86,9 @@ public function getDefaultOptions(array $options)
{
$defaultOptions = array(
'configs' => array(
- 'fileExt' => '*.jpg;*.gif;*.png;*.jpeg',
+ 'fileExt' => '*.jpg;*.gif;*.png;*.jpeg',
'fileDesc' => 'Web Image Files (.jpg, .gif, .png, .jpeg)',
+ 'auto' => true,
)
);
@@ -424,7 +424,7 @@
}
},
onError: function() {
- alert('error');
+ //alert('error');
}
});

0 comments on commit c02184b

Please sign in to comment.