Complete rename ImageSize -> ImageDimensions

This commit is contained in:
Bond-009 2019-02-05 19:53:50 +01:00
parent 0ef2b46106
commit e216702bcf
6 changed files with 27 additions and 14 deletions

View File

@ -368,10 +368,10 @@ namespace Emby.Drawing
return GetCachePath(ResizedImageCachePath, filename, "." + format.ToString().ToLowerInvariant());
}
public ImageDimensions GetImageSize(BaseItem item, ItemImageInfo info)
=> GetImageSize(item, info, true);
public ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info)
=> 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 height = info.Height;
@ -384,7 +384,7 @@ namespace Emby.Drawing
string path = info.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.Height = size.Height;
@ -399,7 +399,7 @@ namespace Emby.Drawing
/// <summary>
/// Gets the size of the image.
/// </summary>
public ImageDimensions GetImageSize(string path)
public ImageDimensions GetImageDimensions(string path)
=> _imageEncoder.GetImageSize(path);
/// <summary>

View File

@ -181,7 +181,7 @@ namespace Emby.Photos
try
{
var size = _imageProcessor.GetImageSize(item, img, false);
var size = _imageProcessor.GetImageDimensions(item, img, false);
if (size.Width > 0 && size.Height > 0)
{

View File

@ -1418,7 +1418,7 @@ namespace Emby.Server.Implementations.Dto
try
{
size = _imageProcessor.GetImageSize(item, imageInfo);
size = _imageProcessor.GetImageDimensions(item, imageInfo);
if (size.Width <= 0 || size.Height <= 0)
{

View File

@ -324,7 +324,7 @@ namespace MediaBrowser.Api.Images
var fileInfo = _fileSystem.GetFileInfo(info.Path);
length = fileInfo.Length;
ImageDimensions size = _imageProcessor.GetImageSize(item, info, true);
ImageDimensions size = _imageProcessor.GetImageDimensions(item, info, true);
width = size.Width;
height = size.Height;

View File

@ -26,16 +26,29 @@ namespace MediaBrowser.Controller.Drawing
/// <value>The image enhancers.</value>
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>
/// Gets the size of the image.
/// Gets the dimensions of the image.
/// </summary>
/// <param name="item">The base item.</param>
/// <param name="info">The information.</param>
/// <returns>ImageSize.</returns>
ImageDimensions GetImageSize(BaseItem item, ItemImageInfo info);
/// <returns>ImageDimensions</returns>
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>
/// Adds the parts.

View File

@ -1,7 +1,7 @@
namespace MediaBrowser.Model.Drawing
{
/// <summary>
/// Struct ImageSize
/// Struct ImageDimensions
/// </summary>
public struct ImageDimensions
{