move image magick files

pull/702/head
Luke Pulverenti 10 years ago
parent 3788033dcd
commit 23a062103a

@ -1,5 +1,4 @@
using ImageMagickSharp; using MediaBrowser.Common.IO;
using MediaBrowser.Common.IO;
using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Drawing;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using System; using System;
@ -46,8 +45,6 @@ namespace MediaBrowser.Server.Implementations.Drawing
/// <returns>The dimensions of the specified image.</returns> /// <returns>The dimensions of the specified image.</returns>
/// <exception cref="ArgumentException">The image was of an unrecognised format.</exception> /// <exception cref="ArgumentException">The image was of an unrecognised format.</exception>
public static ImageSize GetDimensions(string path, ILogger logger, IFileSystem fileSystem) public static ImageSize GetDimensions(string path, ILogger logger, IFileSystem fileSystem)
{
try
{ {
using (var fs = File.OpenRead(path)) using (var fs = File.OpenRead(path))
{ {
@ -57,23 +54,6 @@ namespace MediaBrowser.Server.Implementations.Drawing
} }
} }
} }
catch
{
logger.Info("Failed to read image header for {0}. Doing it the slow way.", path);
}
using (var wand = new MagickWand())
{
wand.PingImage(path);
var img = wand.CurrentImage;
return new ImageSize
{
Width = img.Width,
Height = img.Height
};
}
}
/// <summary> /// <summary>
/// Gets the dimensions of an image. /// Gets the dimensions of an image.

@ -450,12 +450,34 @@ namespace MediaBrowser.Server.Implementations.Drawing
/// <returns>ImageSize.</returns> /// <returns>ImageSize.</returns>
private ImageSize GetImageSizeInternal(string path) private ImageSize GetImageSizeInternal(string path)
{ {
ImageSize size;
try
{
size = ImageHeader.GetDimensions(path, _logger, _fileSystem);
}
catch
{
_logger.Info("Failed to read image header for {0}. Doing it the slow way.", path);
CheckDisposed(); CheckDisposed();
var size = ImageHeader.GetDimensions(path, _logger, _fileSystem);
using (var wand = new MagickWand())
{
wand.PingImage(path);
var img = wand.CurrentImage;
size = new ImageSize
{
Width = img.Width,
Height = img.Height
};
}
}
StartSaveImageSizeTimer(); StartSaveImageSizeTimer();
return new ImageSize { Width = size.Width, Height = size.Height }; return size;
} }
private readonly Timer _saveImageSizeTimer; private readonly Timer _saveImageSizeTimer;

@ -41,7 +41,7 @@ namespace MediaBrowser.ServerApplication
var applicationPath = currentProcess.MainModule.FileName; var applicationPath = currentProcess.MainModule.FileName;
Wand.SetMagickCoderModulePath(Path.Combine(Path.GetDirectoryName(applicationPath), "ImageMagickCoders", "x86")); //Wand.SetMagickCoderModulePath(Path.Combine(Path.GetDirectoryName(applicationPath), "ImageMagickCoders", "x86"));
var appPaths = CreateApplicationPaths(applicationPath, _isRunningAsService); var appPaths = CreateApplicationPaths(applicationPath, _isRunningAsService);
var logManager = new NlogManager(appPaths.LogDirectoryPath, "server"); var logManager = new NlogManager(appPaths.LogDirectoryPath, "server");

@ -239,163 +239,163 @@
<Content Include="CORE_RL_zlib_.dll"> <Content Include="CORE_RL_zlib_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_bgr_.dll"> <Content Include="IM_MOD_RL_bgr_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_bmp_.dll"> <Content Include="IM_MOD_RL_bmp_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_caption_.dll"> <Content Include="IM_MOD_RL_caption_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_clipboard_.dll"> <Content Include="IM_MOD_RL_clipboard_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_clip_.dll"> <Content Include="IM_MOD_RL_clip_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_cmyk_.dll"> <Content Include="IM_MOD_RL_cmyk_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_cut_.dll"> <Content Include="IM_MOD_RL_cut_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_dib_.dll"> <Content Include="IM_MOD_RL_dib_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_emf_.dll"> <Content Include="IM_MOD_RL_emf_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_gif_.dll"> <Content Include="IM_MOD_RL_gif_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_gradient_.dll"> <Content Include="IM_MOD_RL_gradient_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_gray_.dll"> <Content Include="IM_MOD_RL_gray_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_hdr_.dll"> <Content Include="IM_MOD_RL_hdr_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_histogram_.dll"> <Content Include="IM_MOD_RL_histogram_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_html_.dll"> <Content Include="IM_MOD_RL_html_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_icon_.dll"> <Content Include="IM_MOD_RL_icon_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_info_.dll"> <Content Include="IM_MOD_RL_info_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_jpeg_.dll"> <Content Include="IM_MOD_RL_jpeg_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_json_.dll"> <Content Include="IM_MOD_RL_json_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_label_.dll"> <Content Include="IM_MOD_RL_label_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_magick_.dll"> <Content Include="IM_MOD_RL_magick_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_map_.dll"> <Content Include="IM_MOD_RL_map_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_mask_.dll"> <Content Include="IM_MOD_RL_mask_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_matte_.dll"> <Content Include="IM_MOD_RL_matte_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_mat_.dll"> <Content Include="IM_MOD_RL_mat_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_meta_.dll"> <Content Include="IM_MOD_RL_meta_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_miff_.dll"> <Content Include="IM_MOD_RL_miff_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_mono_.dll"> <Content Include="IM_MOD_RL_mono_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_mpeg_.dll"> <Content Include="IM_MOD_RL_mpeg_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_null_.dll"> <Content Include="IM_MOD_RL_null_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_pattern_.dll"> <Content Include="IM_MOD_RL_pattern_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_pdf_.dll"> <Content Include="IM_MOD_RL_pdf_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_png_.dll"> <Content Include="IM_MOD_RL_png_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_preview_.dll"> <Content Include="IM_MOD_RL_preview_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_ps2_.dll"> <Content Include="IM_MOD_RL_ps2_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_ps3_.dll"> <Content Include="IM_MOD_RL_ps3_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_psd_.dll"> <Content Include="IM_MOD_RL_psd_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_ps_.dll"> <Content Include="IM_MOD_RL_ps_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_raw_.dll"> <Content Include="IM_MOD_RL_raw_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_rgb_.dll"> <Content Include="IM_MOD_RL_rgb_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_screenshot_.dll"> <Content Include="IM_MOD_RL_screenshot_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_thumbnail_.dll"> <Content Include="IM_MOD_RL_thumbnail_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_tiff_.dll"> <Content Include="IM_MOD_RL_tiff_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_tile_.dll"> <Content Include="IM_MOD_RL_tile_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_ttf_.dll"> <Content Include="IM_MOD_RL_ttf_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_txt_.dll"> <Content Include="IM_MOD_RL_txt_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_url_.dll"> <Content Include="IM_MOD_RL_url_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_uyvy_.dll"> <Content Include="IM_MOD_RL_uyvy_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_wbmp_.dll"> <Content Include="IM_MOD_RL_wbmp_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_webp_.dll"> <Content Include="IM_MOD_RL_webp_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_wmf_.dll"> <Content Include="IM_MOD_RL_wmf_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_xps_.dll"> <Content Include="IM_MOD_RL_xps_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ImageMagickCoders\x86\IM_MOD_RL_yuv_.dll"> <Content Include="IM_MOD_RL_yuv_.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Resources\Images\Icon.ico" /> <Content Include="Resources\Images\Icon.ico" />
@ -455,6 +455,9 @@
<Name>MediaBrowser.XbmcMetadata</Name> <Name>MediaBrowser.XbmcMetadata</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="ImageMagickCoders\x86\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent> <PostBuildEvent>

Loading…
Cancel
Save