Skip to content

Commit

Permalink
Prepare 1.0.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Sep 25, 2018
1 parent 66aff77 commit 01e78dc
Show file tree
Hide file tree
Showing 22 changed files with 127 additions and 78 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ language: csharp

mono: none

dotnet: 2.1.401
dotnet: 2.1.402

env:
global:
- VIPS_VERSION=8.7.0
- VIPS_PRE_VERSION=rc2
- VIPS_TAR_VERSION=$VIPS_VERSION-rc2
- VIPS_TAR_VERSION=$VIPS_VERSION
- VIPS_WARNING=0
- PATH=$HOME/vips/bin:$PATH
- LD_LIBRARY_PATH=$HOME/vips/lib:$LD_LIBRARY_PATH
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.5] - 2018-09-25
### Added
- Bundle pre-compiled libvips binary and its dependencies for 32-bit Windows.

### Fixed
- Fix five small memleaks ([libvips/lua-vips#24](https://github.com/libvips/lua-vips/issues/24)).

### Changed
- Update bundled libvips binary to 8.7.0.

## [1.0.4] - 2018-06-28
### Added
- Add `contains` helper (to check if the image contains an property of metadata).
Expand Down Expand Up @@ -41,6 +51,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Added
- First release!

[1.0.5]: https://github.com/kleisauke/net-vips/compare/v1.0.4...v1.0.5
[1.0.4]: https://github.com/kleisauke/net-vips/compare/v1.0.3...v1.0.4
[1.0.3]: https://github.com/kleisauke/net-vips/compare/v1.0.2...v1.0.3
[1.0.2]: https://github.com/kleisauke/net-vips/compare/v1.0.1...v1.0.2
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ RUN apt-get update && \
libcfitsio-dev libopenslide-dev libwebp-dev libgsf-1-dev libgirepository1.0-dev gtk-doc-tools

ENV LIBVIPS_VERSION_MAJOR 8
ENV LIBVIPS_VERSION_MINOR 6
ENV LIBVIPS_VERSION_PATCH 5
ENV LIBVIPS_VERSION_MINOR 7
ENV LIBVIPS_VERSION_PATCH 0
ENV LIBVIPS_VERSION $LIBVIPS_VERSION_MAJOR.$LIBVIPS_VERSION_MINOR.$LIBVIPS_VERSION_PATCH

RUN \
# Build libvips
cd /tmp && \
curl -L -O https://github.com/jcupitt/libvips/releases/download/v$LIBVIPS_VERSION/vips-$LIBVIPS_VERSION.tar.gz && \
curl -L -O https://github.com/libvips/libvips/releases/download/v$LIBVIPS_VERSION/vips-$LIBVIPS_VERSION.tar.gz && \
tar zxvf vips-$LIBVIPS_VERSION.tar.gz && \
cd /tmp/vips-$LIBVIPS_VERSION && \
./configure --enable-debug=no --without-python $1 && \
Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Build Status](https://travis-ci.org/kleisauke/net-vips.svg?branch=master)](https://travis-ci.org/kleisauke/net-vips)
[![Build status](https://ci.appveyor.com/api/projects/status/d2r9uanb5yij07pt/branch/master?svg=true)](https://ci.appveyor.com/project/kleisauke/net-vips/branch/master)

This NuGet package provides a Mono/.NET binding for the [libvips image processing library](https://jcupitt.github.io/libvips).
This NuGet package provides a Mono/.NET binding for the [libvips image processing library](https://libvips.github.io/libvips).

This binding passes the vips test suite cleanly with no leaks on Windows, macOS and Linux.

Expand Down Expand Up @@ -81,12 +81,21 @@ If you wish to not use the bundled libvips, you could set the
</PropertyGroup>
```

```bash
dotnet build /p:UseGlobalLibvips=true
This property ensures that the bundled libvips binaries are not copied
to your project's output directory. Instead, it will search for the
required binaries in the directories that are specified in the `PATH`
environment variable.

If you want to specify the path where the libvips binaries are
located, set the `LibvipsDLLPath` property:
```xml
<PropertyGroup>
<LibvipsDLLPath>C:\vips-dev-w64-web\bin</LibvipsDLLPath>
</PropertyGroup>
```

This property prevents that the bundled libvips binary and its
dependencies will be copied to your project's output directory.
This property overrides the bundled libvips binary path and will copy the
binaries from the the specified path to your project's output directory.

## Example

Expand All @@ -98,7 +107,7 @@ var im = Image.NewFromFile("image.jpg");
// put im at position (100, 100) in a 3000 x 3000 pixel image,
// make the other pixels in the image by mirroring im up / down /
// left / right, see
// https://jcupitt.github.io/libvips/API/current/libvips-conversion.html#vips-embed
// https://libvips.github.io/libvips/API/current/libvips-conversion.html#vips-embed
im = im.Embed(100, 100, 3000, 3000, extend: Enums.Extend.Mirror);

// multiply the green (middle) band by 2, leave the other two alone
Expand Down
7 changes: 3 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
image: Visual Studio 2017

# Version format
version: 1.0.4.{build}
version: 1.0.5.{build}

init:
- git config --global core.autocrlf true

# Environment
environment:
VIPS_VERSION: "8.7.0"
VIPS_PRE_VERSION: "rc2"
VIPS_ZIP_VERSION: "dev-w64-web-8.7.0"
VIPS_ZIP_VERSION: "8.7.0"
VIPS_WARNING: 0

# Build script
build_script:
- ps: $env:VIPS_HOME = "C:\vips-dev-$env:VIPS_VERSION"
- ps: $env:PATH = "$env:VIPS_HOME\bin;$env:PATH"
- ps: $env:PATH = "$env:VIPS_HOME\win-x64\bin;$env:PATH"
- ps: .\build.ps1

# Do not build on tags (GitHub only)
Expand Down
86 changes: 52 additions & 34 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var isOnAppVeyorAndNotPR = AppVeyor.IsRunningOnAppVeyor && !AppVeyor.Environment
var vipsHome = EnvironmentVariable("VIPS_HOME");

const string downloadDir = "./download/";
const string dllPackDir = "./pack/";
const string packDir = "./pack/";

// Tasks
Task("Clean")
Expand All @@ -20,7 +20,7 @@ Task("Clean")
CleanDirectory(buildDir);
});

Task("Install-Libvips")
Task("Download-Binaries")
.WithCriteria(IsRunningOnWindows())
.IsDependentOn("Clean")
.Does(() =>
Expand All @@ -33,41 +33,46 @@ Task("Install-Libvips")

var zipVersion = EnvironmentVariable("VIPS_ZIP_VERSION");

var fileName = $"vips-{zipVersion}.zip";
var vipsZip = $"https://github.com/kleisauke/build-win64-mxe/releases/download/v{version}/{fileName}";

var outputPath = new DirectoryPath(downloadDir).CombineWithFilePath(fileName);
if (!FileExists(outputPath))
{
Information("libvips zip file not in download directory. Downloading now ...");
EnsureDirectoryExists(downloadDir);
DownloadFile(vipsZip, outputPath);
}

if (DirectoryExists(vipsHome))
foreach (var architecture in new []{"win-x64","win-x86"})
{
Information("Removing old libvips");
DeleteDirectory(vipsHome, new DeleteDirectorySettings {
var bitness = (architecture == "win-x86") ? "32" : "64";
var fileName = $"vips-dev-w{bitness}-web-{zipVersion}.zip";
var vipsZip = $"https://github.com/kleisauke/build-win64-mxe/releases/download/v{version}/{fileName}";

var zipFile = new DirectoryPath(downloadDir).CombineWithFilePath(fileName);
if (!FileExists(zipFile))
{
Information($"libvips {architecture} zip file not in download directory. Downloading now ...");
EnsureDirectoryExists(downloadDir);
DownloadFile(vipsZip, zipFile);
}

var outputPath = vipsHome + "/" + architecture;
if (DirectoryExists(outputPath))
{
Information($"Removing old libvips {architecture}");
DeleteDirectory(outputPath, new DeleteDirectorySettings {
Recursive = true,
Force = true
});
}

Information("Uncompressing zip file ...");
Unzip(zipFile, outputPath);

// Need to remove toplevel dir from zip container
var containerDir = GetDirectories(outputPath + "/*").First(x => x.GetDirectoryName().StartsWith("vips-"));
CopyDirectory(containerDir, outputPath);
DeleteDirectory(containerDir, new DeleteDirectorySettings {
Recursive = true,
Force = true
});
}

Information("Uncompressing zip file ...");
Unzip(outputPath, vipsHome);

// Need to remove toplevel dir from zip container
var containerDir = GetDirectories(vipsHome + "/*").First(x => x.GetDirectoryName().StartsWith("vips-"));
CopyDirectory(containerDir, vipsHome);
DeleteDirectory(containerDir, new DeleteDirectorySettings {
Recursive = true,
Force = true
});
});

// Run dotnet restore to restore all package references.
Task("Restore")
.IsDependentOn("Install-Libvips")
.IsDependentOn("Download-Binaries")
.Does(() =>
{
DotNetCoreRestore("./src/NetVips/NetVips.csproj");
Expand All @@ -89,19 +94,32 @@ Task("Pack")
.WithCriteria((isOnAppVeyorAndNotPR || string.Equals(target, "pack", StringComparison.OrdinalIgnoreCase)) && IsRunningOnWindows())
.Does(() =>
{
if (DirectoryExists(dllPackDir))
if (DirectoryExists(packDir))
{
Information("Removing old packaging directory");
DeleteDirectory(dllPackDir, new DeleteDirectorySettings {
DeleteDirectory(packDir, new DeleteDirectorySettings {
Recursive = true,
Force = true
});
}

EnsureDirectoryExists(dllPackDir);

// Copy binaries to packaging directory
CopyFiles(vipsHome + "/bin/*.dll", dllPackDir);
EnsureDirectoryExists(packDir);

foreach (var architecture in new []{"win-x64","win-x86"})
{
var dllPackDir = new DirectoryPath(packDir + "/" + architecture);
EnsureDirectoryExists(dllPackDir);

// Copy binaries to packaging directory
CopyFiles(vipsHome + "/" + architecture + "/bin/*.dll", dllPackDir);

// Clean unused DDL's
var deleteFiles = new FilePath[] {
dllPackDir.CombineWithFilePath("libvips-cpp-42.dll"),
dllPackDir.CombineWithFilePath("libstdc++-6.dll")
};
DeleteFiles(deleteFiles);
}

// Need to build the OSX and Linux DLL first.
DotNetCoreBuild("./build/NetVips.batch.csproj", new DotNetCoreBuildSettings
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
TOOLS_DIR=$SCRIPT_DIR/tools
TOOLS_PROJ=$TOOLS_DIR/tools.csproj
CAKE_VERSION=0.29.0
CAKE_VERSION=0.30.0
CAKE_DLL=$TOOLS_DIR/Cake.CoreCLR.$CAKE_VERSION/cake.coreclr/$CAKE_VERSION/Cake.dll


Expand Down
23 changes: 17 additions & 6 deletions build/NetVips.targets
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Condition="'$(OS)' == 'Windows_NT' And '$(UseGlobalLibvips)' != 'true'">
<NativeDLL Include="$(MSBuildThisFileDirectory)\..\..\runtimes\win-x64\native\*.dll" />
<Content Include="@(NativeDLL)">
<Link>%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<PropertyGroup Condition="'$(OS)'=='Windows_NT' And '$(UseGlobalLibvips)'!='true' And '$(LibvipsDLLPath)'==''">
<!-- Prefer x64 over x86 -->
<LibvipsDLLPath Condition="'$(Platform)'=='AnyCPU' OR '$(Platform)'=='x64'">$(MSBuildThisFileDirectory)\..\win-x64</LibvipsDLLPath>
<LibvipsDLLPath Condition="'$(Platform)'=='x86'">$(MSBuildThisFileDirectory)\..\win-x86</LibvipsDLLPath>
<LibvipsBuildArch Condition="'$(Platform)'=='AnyCPU' OR '$(Platform)'=='x64'">x64</LibvipsBuildArch>
<LibvipsBuildArch Condition="'$(Platform)'=='x86'">x86</LibvipsBuildArch>
</PropertyGroup>
<ItemGroup Condition="'$(LibvipsDLLPath)'!=''">
<None Include="$(LibvipsDLLPath)\*.dll">
<Link>%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="NetVipsBuildImports" BeforeTargets="PrepareForBuild">
<Message Text="NetVips compiles with a bundled libvips $(LibvipsBuildArch)-binary" Condition="'$(LibvipsBuildArch)'!=''" Importance="High" />
<Message Text="NetVips compiles with a custom libvips binary (DLL path: $(LibvipsDLLPath))" Condition="'$(LibvipsBuildArch)'=='' And '$(LibvipsDLLPath)'!=''" Importance="High" />
<Message Text="NetVips compiles with a global libvips binary from the PATH environment variable" Condition="'$(LibvipsDLLPath)'=='' And '$(UseGlobalLibvips)'=='true'" Importance="High" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion build/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<Major>1</Major>
<Minor>0</Minor>
<Revision>4</Revision>
<Revision>5</Revision>

<BuildNumber Condition=" '$(APPVEYOR_BUILD_NUMBER)' != '' ">$(APPVEYOR_BUILD_NUMBER)</BuildNumber>
<BuildNumber Condition=" '$(BuildNumber)' == '' ">0</BuildNumber>
Expand Down
2 changes: 1 addition & 1 deletion build/install-vips.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
version=${VIPS_VERSION}
pre_version=${VIPS_PRE_VERSION}
tar_version=${VIPS_TAR_VERSION}
vips_tarball=https://github.com/jcupitt/libvips/releases/download/v${version}${pre_version:+-$pre_version}/vips-${tar_version}.tar.gz
vips_tarball=https://github.com/libvips/libvips/releases/download/v${version}${pre_version:+-$pre_version}/vips-${tar_version}.tar.gz

set -e

Expand Down
2 changes: 1 addition & 1 deletion documentation/Generator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="docfx.console" Version="2.38.1">
<PackageReference Include="docfx.console" Version="2.39.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion samples/NetVips.Samples/Samples/CaptchaGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace NetVips.Samples
{
/// <summary>
/// From: https://github.com/jcupitt/libvips/issues/898
/// From: https://github.com/libvips/libvips/issues/898
/// </summary>
public class CaptchaGenerator : ISample
{
Expand Down
2 changes: 1 addition & 1 deletion samples/NetVips.Samples/Samples/Combine.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetVips.Samples
{
/// <summary>
/// From: https://github.com/jcupitt/lua-vips/blob/master/example/combine.lua
/// From: https://github.com/libvips/lua-vips/blob/master/example/combine.lua
/// </summary>
public class Combine : ISample
{
Expand Down
4 changes: 2 additions & 2 deletions samples/NetVips.Samples/Samples/EmbedMultiplyConv.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetVips.Samples
{
/// <summary>
/// From: https://github.com/jcupitt/ruby-vips#example
/// From: https://github.com/libvips/ruby-vips#example
/// </summary>
public class EmbedMultiplyConv : ISample
{
Expand All @@ -17,7 +17,7 @@ public string Execute(string[] args)
// put im at position (100, 100) in a 3000 x 3000 pixel image,
// make the other pixels in the image by mirroring im up / down /
// left / right, see
// https://jcupitt.github.io/libvips/API/current/libvips-conversion.html#vips-embed
// https://libvips.github.io/libvips/API/current/libvips-conversion.html#vips-embed
im = im.Embed(100, 100, 3000, 3000, extend: Enums.Extend.Mirror);

// multiply the green (middle) band by 2, leave the other two alone
Expand Down
2 changes: 1 addition & 1 deletion samples/NetVips.Samples/Samples/HelloWorld.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NetVips.Samples
{
/// <summary>
/// From: https://github.com/jcupitt/lua-vips/blob/master/example/hello-world.lua
/// From: https://github.com/libvips/lua-vips/blob/master/example/hello-world.lua
/// </summary>
public class HelloWorld : ISample
{
Expand Down
2 changes: 1 addition & 1 deletion samples/NetVips.Samples/Samples/LeakTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace NetVips.Samples
{
/// <summary>
/// From: https://raw.githubusercontent.com/jcupitt/node-vips/master/example/thumb.js
/// From: https://github.com/libvips/node-vips/blob/master/example/thumb.js
/// </summary>
public class LeakTest : ISample
{
Expand Down
2 changes: 1 addition & 1 deletion samples/NetVips.Samples/Samples/OnePointMosaic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace NetVips.Samples
{
/// <summary>
/// From: https://github.com/jcupitt/nip2/tree/master/share/nip2/data/examples/1_point_mosaic
/// From: https://github.com/libvips/nip2/tree/master/share/nip2/data/examples/1_point_mosaic
/// </summary>
public class OnePointMosaic : ISample
{
Expand Down
2 changes: 1 addition & 1 deletion samples/NetVips.Samples/Samples/ShapeCropping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace NetVips.Samples
{
/// <summary>
/// From: https://github.com/andrieslouw/imagesweserv/blob/3.x/src/Manipulators/Shape.php
/// From: https://github.com/weserv/images/blob/3.x/src/Manipulators/Shape.php
/// </summary>
public class ShapeCropping : ISample
{
Expand Down
Loading

0 comments on commit 01e78dc

Please sign in to comment.