Skip to content

Commit

Permalink
Refactored last merge and updated version number.
Browse files Browse the repository at this point in the history
  • Loading branch information
blueimp committed Jan 3, 2014
1 parent c8d4504 commit 0b4340d
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions server/php/UploadHandler.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* jQuery File Upload Plugin PHP Class 7.1.1
* jQuery File Upload Plugin PHP Class 7.1.2
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
Expand Down Expand Up @@ -34,9 +34,8 @@ class UploadHandler
'min_width' => 'Image requires a minimum width',
'max_height' => 'Image exceeds maximum height',
'min_height' => 'Image requires a minimum height',
'abort' => 'Image Upload aborted',
'single_scale' => 'Failed to create scaled version: ',
'multi_scale' => 'Failed to create scaled versions: '
'abort' => 'File upload aborted',
'image_resize' => 'Failed to resize image'
);

protected $image_objects = array();
Expand Down Expand Up @@ -1006,19 +1005,12 @@ protected function handle_image_file($file_path, $file) {
$file->size = $this->get_file_size($file_path, true);
}
} else {
$failed_versions[] = $version;
$failed_versions[] = $version ? $version : 'original';
}
}
switch (count($failed_versions)) {
case 0:
break;
case 1:
$file->error = $this->get_error_message('single_scale')
.$failed_versions[0];
break;
default:
$file->error = $this->get_error_message('multi_scale')
.implode($failed_versions,', ');
if (count($failed_versions)) {
$file->error = $this->get_error_message('image_resize')
.' ('.implode($failed_versions,', ').')';
}
// Free memory:
$this->destroy_image_object($file_path);
Expand Down

0 comments on commit 0b4340d

Please sign in to comment.