return $image->path;
}
+ /**
+ * Checks if the image is a gif. Returns true if it is, else false.
+ * @param Image $image
+ * @return boolean
+ */
+ protected function isGif(Image $image) {
+ return strtolower(pathinfo($this->getPath($image), PATHINFO_EXTENSION)) === 'gif';
+ }
+
/**
* Get the thumbnail for an image.
* If $keepRatio is true only the width will be used.
*/
public function getThumbnail(Image $image, $width = 220, $height = 220, $keepRatio = false)
{
+ if ($keepRatio && $this->isGif($image)) {
+ return $this->getPublicUrl($this->getPath($image));
+ }
+
$thumbDirName = '/' . ($keepRatio ? 'scaled-' : 'thumbs-') . $width . '-' . $height . '/';
$imagePath = $this->getPath($image);
$thumbFilePath = dirname($imagePath) . $thumbDirName . basename($imagePath);
dz.on('error', function (file, errorMessage, xhr) {
_this.$emit('error', {file, errorMessage, xhr});
- console.log(errorMessage);
- console.log(xhr);
+
function setMessage(message) {
$(file.previewElement).find('[data-dz-errormessage]').text(message);
}
if (xhr && xhr.status === 413) setMessage(trans('errors.server_upload_limit'));
- if (errorMessage.file) setMessage(errorMessage.file[0]);
+ else if (errorMessage.file) setMessage(errorMessage.file);
+
});
}
});