Commit 92eef08b authored by Tino Goratsch's avatar Tino Goratsch

Merge branch 'hotfix/v4.31.1'

parents e5f9e5fe 4dfe3de4
Pipeline #33719369 passed with stages
in 8 minutes and 42 seconds
......@@ -16,7 +16,7 @@ interface BootstrapInterface extends HttpKernelInterface
/**
* Contains the current ACP3 version string.
*/
const VERSION = '4.31.0';
const VERSION = '4.31.1';
/**
* Performs some startup checks.
......
......@@ -47,7 +47,7 @@ class Picture
if (\is_file($input->getFile()) === true) {
$cacheFile = $this->getCacheFileName($input);
$picInfo = $this->fastImageSize->getImageSize($input->getFile());
$picInfo = $this->getPictureInfo($input->getFile());
$output = new Output($this->appPath, $input->getFile(), $picInfo['type']);
$output->setSrcWidth($picInfo['width']);
......@@ -96,6 +96,37 @@ class Picture
return $input->getCachePrefix() . \substr($input->getFile(), \strrpos($input->getFile(), '/') + 1);
}
/**
* @param string $fileName
*
* @return array
*
* @throws \ACP3\Core\Picture\Exception\PictureGenerateException
*/
private function getPictureInfo(string $fileName): array
{
$picInfo = $this->fastImageSize->getImageSize($fileName);
// If fastImageSize fails, try it with PHP's standard getimagesize() function
if ($picInfo === false) {
$info = \getimagesize($fileName);
if ($info === false) {
throw new PictureGenerateException(
\sprintf('Could not get image size information for picture <%s>!', $fileName)
);
}
$picInfo = [
'width' => $info[0],
'height' => $info[1],
'type' => $info[2],
];
}
return $picInfo;
}
/**
* @param \ACP3\Core\Picture\Input $input
* @param \ACP3\Core\Picture\Output $output
......
......@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [4.31.1] - 2018-10-21
### Fixed
- fallback to PHP's standard `getimagesize()` function if the FastImageSize library fails to retrieve the information of a picture
## [4.31.0] - 2018-10-21
### Added
- added the possibility to add a description to galleries
......@@ -742,7 +746,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- It should be possible again to save ACL roles
- Silenced a possible PHP warning when trying to login with incorrect credentials
[Unreleased]: https://gitlab.com/ACP3/cms/compare/v4.31.0...HEAD
[Unreleased]: https://gitlab.com/ACP3/cms/compare/v4.31.1...HEAD
[4.31.1]: https://gitlab.com/ACP3/cms/compare/v4.31.0...v4.31.1
[4.31.0]: https://gitlab.com/ACP3/cms/compare/v4.30.4...v4.31.0
[4.30.4]: https://gitlab.com/ACP3/cms/compare/v4.30.3...v4.30.4
[4.30.3]: https://gitlab.com/ACP3/cms/compare/v4.30.2...v4.30.3
......
{
"name": "acp3-cms",
"version": "4.31.0",
"version": "4.31.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
{
"name": "acp3-cms",
"version": "4.31.0",
"version": "4.31.1",
"description": "The ACP3 CMS is a highly customizable and easy to use Web Content Management System based on PHP and MySQL.",
"main": "",
"directories": {},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment