Merge pull request #822 from Bond-009/imagedimensions
Complete rename ImageSize -> ImageDimensions
This commit is contained in:
commit
3a88a3c795
|
@ -368,10 +368,10 @@ namespace Emby.Drawing
|
||||||
return GetCachePath(ResizedImageCachePath, filename, "." + format.ToString().ToLowerInvariant());
|
return GetCachePath(ResizedImageCachePath, filename, "." + format.ToString().ToLowerInvariant());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImageDimensions GetImageSize(BaseItem item, ItemImageInfo info)
|
public ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info)
|
||||||
=> GetImageSize(item, info, true);
|
=> GetImageDimensions(item, info, true);
|
||||||
|
|
||||||
public ImageDimensions GetImageSize(BaseItem item, ItemImageInfo info, bool updateItem)
|
public ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info, bool updateItem)
|
||||||
{
|
{
|
||||||
int width = info.Width;
|
int width = info.Width;
|
||||||
int height = info.Height;
|
int height = info.Height;
|
||||||
|
@ -384,7 +384,7 @@ namespace Emby.Drawing
|
||||||
string path = info.Path;
|
string path = info.Path;
|
||||||
_logger.LogInformation("Getting image size for item {ItemType} {Path}", item.GetType().Name, path);
|
_logger.LogInformation("Getting image size for item {ItemType} {Path}", item.GetType().Name, path);
|
||||||
|
|
||||||
ImageDimensions size = GetImageSize(path);
|
ImageDimensions size = GetImageDimensions(path);
|
||||||
info.Width = size.Width;
|
info.Width = size.Width;
|
||||||
info.Height = size.Height;
|
info.Height = size.Height;
|
||||||
|
|
||||||
|
@ -399,7 +399,7 @@ namespace Emby.Drawing
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the size of the image.
|
/// Gets the size of the image.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ImageDimensions GetImageSize(string path)
|
public ImageDimensions GetImageDimensions(string path)
|
||||||
=> _imageEncoder.GetImageSize(path);
|
=> _imageEncoder.GetImageSize(path);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -181,7 +181,7 @@ namespace Emby.Photos
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var size = _imageProcessor.GetImageSize(item, img, false);
|
var size = _imageProcessor.GetImageDimensions(item, img, false);
|
||||||
|
|
||||||
if (size.Width > 0 && size.Height > 0)
|
if (size.Width > 0 && size.Height > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1418,7 +1418,7 @@ namespace Emby.Server.Implementations.Dto
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
size = _imageProcessor.GetImageSize(item, imageInfo);
|
size = _imageProcessor.GetImageDimensions(item, imageInfo);
|
||||||
|
|
||||||
if (size.Width <= 0 || size.Height <= 0)
|
if (size.Width <= 0 || size.Height <= 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -324,7 +324,7 @@ namespace MediaBrowser.Api.Images
|
||||||
var fileInfo = _fileSystem.GetFileInfo(info.Path);
|
var fileInfo = _fileSystem.GetFileInfo(info.Path);
|
||||||
length = fileInfo.Length;
|
length = fileInfo.Length;
|
||||||
|
|
||||||
ImageDimensions size = _imageProcessor.GetImageSize(item, info, true);
|
ImageDimensions size = _imageProcessor.GetImageDimensions(item, info, true);
|
||||||
width = size.Width;
|
width = size.Width;
|
||||||
height = size.Height;
|
height = size.Height;
|
||||||
|
|
||||||
|
|
|
@ -26,16 +26,29 @@ namespace MediaBrowser.Controller.Drawing
|
||||||
/// <value>The image enhancers.</value>
|
/// <value>The image enhancers.</value>
|
||||||
IImageEnhancer[] ImageEnhancers { get; }
|
IImageEnhancer[] ImageEnhancers { get; }
|
||||||
|
|
||||||
ImageDimensions GetImageSize(string path);
|
/// <summary>
|
||||||
|
/// Gets the dimensions of the image.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">Path to the image file.</param>
|
||||||
|
/// <returns>ImageDimensions</returns>
|
||||||
|
ImageDimensions GetImageDimensions(string path);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the size of the image.
|
/// Gets the dimensions of the image.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="item">The base item.</param>
|
||||||
/// <param name="info">The information.</param>
|
/// <param name="info">The information.</param>
|
||||||
/// <returns>ImageSize.</returns>
|
/// <returns>ImageDimensions</returns>
|
||||||
ImageDimensions GetImageSize(BaseItem item, ItemImageInfo info);
|
ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info);
|
||||||
|
|
||||||
ImageDimensions GetImageSize(BaseItem item, ItemImageInfo info, bool updateItem);
|
/// <summary>
|
||||||
|
/// Gets the dimensions of the image.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item">The base item.</param>
|
||||||
|
/// <param name="info">The information.</param>
|
||||||
|
/// <param name="updateItem">Whether or not the item info should be updated.</param>
|
||||||
|
/// <returns>ImageDimensions</returns>
|
||||||
|
ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info, bool updateItem);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds the parts.
|
/// Adds the parts.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
namespace MediaBrowser.Model.Drawing
|
namespace MediaBrowser.Model.Drawing
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Struct ImageSize
|
/// Struct ImageDimensions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public struct ImageDimensions
|
public struct ImageDimensions
|
||||||
{
|
{
|
Loading…
Reference in New Issue
Block a user