mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 01:41:46 +03:00
eef7932e94
refs #8868 - Removed image-size in blog logo fn for meta data and made it synchronous - Renamed `image-size-from-url.js` to `image-size.js` (incl. the test) - Added second fn `getImageSizeFromFilePath` that reads from local file storage - Added guard in `getImageSizeFromUrl` that checks if the image should be on local file storage and uses the new fn then instead - Added a fn `fetchDimensionsFromBuffer` that takes the file buffer and returns an `imageObject` with dimensions. - Added a new utils.js in `adapters/storage` for getting the file storage path
21 lines
680 B
JavaScript
21 lines
680 B
JavaScript
var utils = require('../../utils'),
|
|
settingsCache = require('../../settings/cache'),
|
|
blogIconUtils = require('../../utils/blog-icon');
|
|
|
|
function getBlogLogo() {
|
|
var logo = {};
|
|
|
|
if (settingsCache.get('logo')) {
|
|
logo.url = utils.url.urlFor('image', {image: settingsCache.get('logo')}, true);
|
|
} else {
|
|
// CASE: no publication logo is updated. We can try to use either an uploaded publication icon
|
|
// or use the default one to make
|
|
// Google happy with it. See https://github.com/TryGhost/Ghost/issues/7558
|
|
logo.url = blogIconUtils.getIconUrl(true);
|
|
}
|
|
|
|
return logo;
|
|
}
|
|
|
|
module.exports = getBlogLogo;
|