Browse Source

Fixes #288

pull/289/head
Sebastian 8 years ago
parent
commit
90bccfe593
  1. 4
      src/Squidex.Infrastructure/Assets/ImageSharp/ImageSharpAssetThumbnailGenerator.cs
  2. 3
      src/Squidex/Areas/Api/Controllers/Assets/AssetContentController.cs

4
src/Squidex.Infrastructure/Assets/ImageSharp/ImageSharpAssetThumbnailGenerator.cs

@ -38,8 +38,8 @@ namespace Squidex.Infrastructure.Assets.ImageSharp
resizeMode = ResizeMode.Max; resizeMode = ResizeMode.Max;
} }
var w = width ?? int.MaxValue; var w = width ?? 0;
var h = height ?? int.MaxValue; var h = height ?? 0;
using (var sourceImage = Image.Load(source, out var format)) using (var sourceImage = Image.Load(source, out var format))
{ {

3
src/Squidex/Areas/Api/Controllers/Assets/AssetContentController.cs

@ -46,7 +46,6 @@ namespace Squidex.Areas.Api.Controllers.Assets
/// <summary> /// <summary>
/// Get the asset content. /// Get the asset content.
/// </summary> /// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="id">The id of the asset.</param> /// <param name="id">The id of the asset.</param>
/// <param name="version">The optional version of the asset.</param> /// <param name="version">The optional version of the asset.</param>
/// <param name="width">The target width of the asset, if it is an image.</param> /// <param name="width">The target width of the asset, if it is an image.</param>
@ -60,7 +59,7 @@ namespace Squidex.Areas.Api.Controllers.Assets
[Route("assets/{id}/")] [Route("assets/{id}/")]
[ProducesResponseType(200)] [ProducesResponseType(200)]
[ApiCosts(0.5)] [ApiCosts(0.5)]
public async Task<IActionResult> GetAssetContent(string app, Guid id, [FromQuery] int version = -1, [FromQuery] int? width = null, [FromQuery] int? height = null, [FromQuery] string mode = null) public async Task<IActionResult> GetAssetContent(Guid id, [FromQuery] int version = -1, [FromQuery] int? width = null, [FromQuery] int? height = null, [FromQuery] string mode = null)
{ {
var entity = await assetRepository.FindAssetAsync(id); var entity = await assetRepository.FindAssetAsync(id);

Loading…
Cancel
Save