Skip to content

Commit

Permalink
Remove Conan
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Dec 30, 2017
1 parent e12310f commit 4705447
Show file tree
Hide file tree
Showing 21 changed files with 55 additions and 387 deletions.
76 changes: 30 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,54 @@

[![travis-master](https://img.shields.io/travis/imazen/imageflow/master.svg?label=master%3A%20mac64%20ubuntu64%2014.04%2016.04)](https://travis-ci.org/imazen/imageflow/builds) [![AppVeyor build status](https://ci.appveyor.com/api/projects/status/0356x95fa312m3wy/branch/master?svg=true&passingText=master%3A%20win32%20win64%20-%20passing&failingText=master%3A%20win32%20win64%20-%20failed)](https://ci.appveyor.com/project/imazen/imageflow/branch/master) [![Coverity Scan Build Status](https://scan.coverity.com/projects/8403/badge.svg)](https://scan.coverity.com/projects/imazen-imageflow) [![state: technical preview](https://img.shields.io/badge/state-technical%E2%80%93preview-yellow.svg)](#flaws)

* **imageflow_server** can run jobs or manipulate images in-flight (e.g.`/bucket/img.jpg?w=200`) for direct use from HTML. Source images can reside in blob storage, on another server, or on the filesystem.
* **libimageflow** is for direct (in-process) use from *your* programming language. It has a simple [C-compatible ABI](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/imageflow/index.html) and [bindings](https://github.com/imazen/imageflow/tree/master/bindings).
* **imageflow_server** can run jobs or manipulate images in-flight (e.g.`/bucket/img.jpg?w=200`) for direct use from HTML. Source images can reside in blob storage, on another server, or on the filesystem.
* **libimageflow** is for direct (in-process) use from *your* programming language. It has a simple [C-compatible ABI](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/imageflow/index.html) and [bindings](https://github.com/imazen/imageflow/tree/master/bindings).
* **imageflow_tool** is a command-line tool for experimenting, running batch jobs, or when you want process isolation. Up to 17x faster than ImageMagick.

These all offer the JSON [`/build` API](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/context_json_api.txt) as well as the traditional `width=300&height=200&mode=crop&format=jpg` command string form. Each is available as a self-contained binary for Windows and Mac. We offer Docker images for Linux (where glibc and OpenSSL are required).
These all offer the JSON [`/build` API](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/context_json_api.txt) as well as the traditional `width=300&height=200&mode=crop&format=jpg` command string form. Each is available as a self-contained binary for Windows and Mac. We offer Docker images for Linux (where glibc and OpenSSL are required).

libimageflow offers interactive job manipulation as well [like `/tell_decoder`, `/get_image_info`, and `/execute`](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/job_json_api.txt). Unless you are using memory buffers for I/O, it's better to use `/build`.
libimageflow offers interactive job manipulation as well [like `/tell_decoder`, `/get_image_info`, and `/execute`](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/job_json_api.txt). Unless you are using memory buffers for I/O, it's better to use `/build`.

[![view releases](https://img.shields.io/badge/-view%20downloads%20and%20releases-green.svg)](https://github.com/imazen/imageflow/releases) or `docker run --rm imazen/imageflow_tool`

[We thank our backers on Kickstarter](https://www.kickstarter.com/projects/njones/imageflow-respect-the-pixels-a-secure-alt-to-image/posts/1616122) and [the many supporters of ImageResizer](https://imageresizing.net) for making this project a reality.
Email [email protected] if you need an AGPLv3 exception for commercial use.
Email [email protected] if you need an AGPLv3 exception for commercial use.

Also, please [send us 'challenging' images and tasks](https://github.com/imazen/imageflow/issues/98). We'd also appreciate it if you'd explore the JSON APIs and [review them and other topics where we are requesting feedback](https://github.com/imazen/imageflow/issues?q=is%3Aopen+is%3Aissue+label%3Arequesting-feedback). And – we need help with benchmarking on Windows.
Also, please [send us 'challenging' images and tasks](https://github.com/imazen/imageflow/issues/98). We'd also appreciate it if you'd explore the JSON APIs and [review them and other topics where we are requesting feedback](https://github.com/imazen/imageflow/issues?q=is%3Aopen+is%3Aissue+label%3Arequesting-feedback). And – we need help with benchmarking on Windows.

If we enough people beta-test Imageflow and provide feedback, we aim to publish a stable 1.0 release in August 2017 (along with Ruby and Node bindings). **See [flaws and missing features](#flaws) for project status.**

## Using imageflow_tool
## Using imageflow_tool

`imageflow_tool examples --generate` - creates an *examples* directory with JSON jobs and invocation scripts.
`imageflow_tool examples --generate` - creates an *examples* directory with JSON jobs and invocation scripts.

You can use command strings that are compatible with [ImageResizer 4 querystrings](https://imageresizing.net/docs/basics):

`imageflow_tool v0.1/ir4 --in source.jpg --out thumb.jpg --command "width=50&height=50&mode=crop&format=jpg" `

Or submit a JSON job file. JSON jobs can have multiple inputs and outputs, and can represent any kind of operation graph.
Or submit a JSON job file. JSON jobs can have multiple inputs and outputs, and can represent any kind of operation graph.

The following generates mutiple sizes of an image from an example job file:
The following generates mutiple sizes of an image from an example job file:

```
imageflow_tool v0.1/build --json examples/export_4_sizes/export_4_sizes.json
imageflow_tool v0.1/build --json examples/export_4_sizes/export_4_sizes.json
--in http://s3-us-west-2.amazonaws.com/imageflow-resources/test_inputs/waterhouse.jpg
--out 1 waterhouse_w1600.jpg
2 waterhouse_w1200.jpg
3 waterhouse_w800.jpg
4 waterhouse_w400.jpg
--out 1 waterhouse_w1600.jpg
2 waterhouse_w1200.jpg
3 waterhouse_w800.jpg
4 waterhouse_w400.jpg
--response operation_result.json
```

By default, imageflow_tool prints a JSON response to stdout. You write this to disk with `--response`.

`--debug-package` will create a .zip file to reproduce problematic behavior with both `v0.1/build` and `v0.1/ir4`. Please sumbit bug reports; we try to make it easy.
`--debug-package` will create a .zip file to reproduce problematic behavior with both `v0.1/build` and `v0.1/ir4`. Please sumbit bug reports; we try to make it easy.

## Using imageflow_server for dynamic imaging

`imageflow_server start --demo`

Now you can edit images from HTML... and use srcset without headache.
Now you can edit images from HTML... and use srcset without headache.

```
<img src="http://localhost:39876/demo_images/u3.jpg?w=300" />
Expand All @@ -62,9 +62,9 @@ Now you can edit images from HTML... and use srcset without headache.

![](https://www.imageflow.io/images/imageflow-responsive.svg) ![](https://www.imageflow.io/images/edit-url.gif)

### Beyond the demo
### Beyond the demo

You'll want to mount varous image source locations to prefixes. The `--mount` command parses a colon (`:`) delimited list of arguments. The first is the prefix you'll use in the URL (like `http://localhost:39876/prefix/`. The second is the engine name. Remaining arguments are sent to the engine.
You'll want to mount varous image source locations to prefixes. The `--mount` command parses a colon (`:`) delimited list of arguments. The first is the prefix you'll use in the URL (like `http://localhost:39876/prefix/`. The second is the engine name. Remaining arguments are sent to the engine.

#### Examples

Expand All @@ -85,15 +85,15 @@ You'll want to mount varous image source locations to prefixes. The `--mount` co
* Ruby - Basic bindings can be found in [bindings/ruby/](https://github.com/imazen/imageflow/tree/master/bindings/ruby)
* Node - Not yet started. Want to help? [generate bindings from the header files](https://github.com/tjfontaine/node-ffi-generate)
* C and C++ - use [bindings/headers/imageflow_default.h](https://github.com/imazen/imageflow/blob/master/bindings/headers/imageflow_default.h) or one of the many alternate conventions provided with each release.
* Rust - Imageflow is written in Rust. Use the `imageflow_core` crate, but be warned that this interface will evolve more rapidly than the FFI `imageflow` crate.
* other languages - Use an [FFI](https://en.wikipedia.org/wiki/Foreign_function_interface) binding-generation tool for your language, and feed it whichever [header file it likes best](https://github.com/imazen/imageflow/tree/master/bindings/headers).
* Rust - Imageflow is written in Rust. Use the `imageflow_core` crate, but be warned that this interface will evolve more rapidly than the FFI `imageflow` crate.
* other languages - Use an [FFI](https://en.wikipedia.org/wiki/Foreign_function_interface) binding-generation tool for your language, and feed it whichever [header file it likes best](https://github.com/imazen/imageflow/tree/master/bindings/headers).

Official Ruby and Node bindings will be released by August 2017.
Official Ruby and Node bindings will be released by August 2017.


# How to build Imageflow from source

We're assuming you've cloned already.
We're assuming you've cloned already.

```bash
git clone [email protected]:imazen/imageflow.git
Expand All @@ -113,7 +113,7 @@ This will create caches within `~/.docker_imageflow_caches` specific to the dock

We need a few packages in order to build the C dependencies. You probably have most of these already.

* build-essential, nasm, dh-autoreconf, pkg-config
* build-essential, nasm, dh-autoreconf, pkg-config
* wget, curl, git
* libpng, libssl, ca-certificates
* python, pip, and setuptools
Expand All @@ -128,24 +128,20 @@ sudo apt-get install --no-install-recommends \
python-minimal python-pip python-setuptools
```

After installing the above, you'll need conan, cmake 3.4.1+, dssim, and Rust Nightly.
After installing the above, you'll need cmake 3.4.1+, dssim, and Rust Nightly.

```bash
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2017-08-01
sudo pip install conan
./ci/nixtools/install_cmake.sh
./ci/nixtools/install_dssim.sh
./build.sh
```

The build will fail with `settings.target_cpu`. Edit `$HOME\.conan\settings.yml`. Append the line `target_cpu: [x86, x86-64, nehalem, sandybridge, haswell, native]`


We aren't listing dependencies needed for
We aren't listing dependencies needed for

* Valgrind (common versions break openssl; you may need to build from source)
* Code coverage
* Bindings.
* Bindings.

Please consult the [official Dockerfiles](https://github.com/imazen/dockerfiles_imageflow) for these.

Expand All @@ -154,14 +150,11 @@ Please consult the [official Dockerfiles](https://github.com/imazen/dockerfiles_
You'll need a bit less on OS X, although this may not be comprehensive:

```bash
brew install conan nasm cmake python libpng automake libtool pkg-config wget
brew install nasm cmake python libpng automake libtool pkg-config wget
./ci/nixtools/install_dssim.sh
./build.sh
```

The build will fail with `settings.target_cpu`. Edit `$HOME\.conan\settings.yml`. Append the line `target_cpu: [x86, x86-64, nehalem, sandybridge, haswell, native]`


## Windows

Don't use a C++ IDE until you've run `win_build_c.bat`, as CMake needs to generate files.
Expand All @@ -170,26 +163,17 @@ Don't use a C++ IDE until you've run `win_build_c.bat`, as CMake needs to genera

1. Visual Studio 2015 (for the C++ build tools)
2. Install [Git 64-bit](https://git-scm.com/download/win).
3. Install [NASM 64-bit](http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win64/nasm-2.12.02-installer-x64.exe) Installer must be `Run as Administrator` - it will not prompt.
3. Install [NASM 64-bit](http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win64/nasm-2.12.02-installer-x64.exe) Installer must be `Run as Administrator` - it will not prompt.
4. Install [Rust 64-bit](https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe). Install toolchain `nightly-2017-06-08` and set it as default. For the moment, 32-bit builds also require [a 32-bit Rust](https://static.rust-lang.org/rustup/dist/i686-pc-windows-msvc/rustup-init.exe).
5. Install [CMake 3.7 64-bit](https://cmake.org/download/) (3.8.0-rc3 makes paths too long)
6. Install [Conan](https://www.conan.io/downloads).

You need all of these to be in %PATH%. Edit `ci/wintools/SETUP_PATH.bat` as appropriate to ensure that cmake, conan, rust/cargo, nasm, git, and Git/mingw64/bin are all available.
You need all of these to be in %PATH%. Edit `ci/wintools/SETUP_PATH.bat` as appropriate to ensure that rust/cargo, nasm, git, and Git/mingw64/bin are all available.

1. Run `win_enter_env.bat` to start a sub-shell with VS tools loaded and a proper PATH. Edit the file per its comments to target a 32-bit build (you may want a separate imageflow folder for each target).
2. Run `win_build_c.bat` from the shell to compile the C components
3. It will fail with `settings.target_cpu`. Edit `$HOME\.conan\settings.yml`. Append the line `target_cpu: [x86, x86-64, nehalem, sandybridge, haswell, native]`
4. `cd ..\..` back to the root and run `win_build_c.bat` again.
5. Run `win_build_rust.bat` to compile the Rust components

`c_components/build/Imageflow.sln` will be created during 'win_build_c.bat', but is only set up for Release mode compilation by default. Switch configuration to Release to get a build. You'll need to run conan install directly if you want to change architecture to `x86`, target_cpu to `haswell`, or build_type to `Debug`, since the solutions need to be regenerated.

cd build
conan install --generator txt --scope build_tests=True -o shared=True --build missing -s build_type=Release -s arch=x86_64 -s target_cpu=sandybridge -u ../
conan build ../


## How does one learn image processing for the web?

First, [read High Performance Images](http://shop.oreilly.com/product/0636920039730.do) for context.
Expand Down
25 changes: 1 addition & 24 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ environment:
CARGO_INCREMENTAL: 1
RUST_TOOLCHAIN: nightly-2017-11-24
VSINSTALL: "Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build"
CONAN_VISUAL_VERSIONS: 15
VS150COMNTOOLS: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\Tools\\"
TARGET_DIR: "target\\"
matrix:
Expand All @@ -18,27 +17,22 @@ environment:
NUGET_RUNTIME: win7-x86
PACKAGE_SUFFIX: win-x86
BITS: 32
CONAN_ARCH: x86
- platform: x64
RUST_TARGET: x86_64-pc-windows-msvc
TARGET_CPU: x86-64
NUGET_RUNTIME: win7-x64
PACKAGE_SUFFIX: win-x86_64
BITS: 64
CONAN_ARCH: x86_64
- platform: x64
RUST_TARGET: x86_64-pc-windows-msvc
TARGET_CPU: haswell
NUGET_RUNTIME: win7-x64
PACKAGE_SUFFIX: win-x86_64-haswell
BITS: 64
CONAN_ARCH: x86_64
configuration: Release

cache:
- '%USERPROFILE%\.cargo'
- '%USERPROFILE%\.conan'
- 'c_components\build'
- 'target'
matrix:
fast_finish: false
Expand Down Expand Up @@ -81,7 +75,7 @@ install:
#- vs_buildtools.exe --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended
#- C:\"Program Files (x86)"\"%VSINSTALL%"\vcvarsall.bat %PLATFORM%
- SET TARGET_ARG= #--target=%RUST_TARGET%
- echo "RUST_TARGET=%RUST_TARGET%, TARGET=%TARGET%, BITS=%BITS%, CPU_TARGET=%CPU_TARGET% CONAN_ARCH=%CONAN_ARCH% RUSTFLAGS=%RUSTFLAGS%"
- echo "RUST_TARGET=%RUST_TARGET%, TARGET=%TARGET%, BITS=%BITS%, CPU_TARGET=%CPU_TARGET% RUSTFLAGS=%RUSTFLAGS%"
- SET RUSTUP_INIT=https://static.rust-lang.org/rustup/dist/%RUST_TARGET%/rustup-init.exe
- echo Fetching %RUSTUP_INIT%
- curl -L -o rustup-init.exe %RUSTUP_INIT%
Expand All @@ -91,11 +85,6 @@ install:
- echo. && echo. && echo Installing NASM
- curl -L -o nasminst.exe http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win64/nasm-2.12.02-installer-x64.exe
- start /wait nasminst.exe /S
- echo. && echo. && echo Installing Conan
- pip.exe install conan
- conan user # Creates the conan data directory
- conan remote add imageflow https://api.bintray.com/conan/imazen/imageflow || exit 0
- copy /Y .\ci\updated_conan_settings.yml C:\Users\appveyor\.conan\settings.yml #Fixes settings.yml

#https://cmake.org/files/v3.9/cmake-3.9.1-win64-x64.msi
test_script:
Expand All @@ -104,25 +93,14 @@ test_script:
- if NOT "%CI_TAG%"=="" rmdir /s /q c_components/build || exit 0
- if NOT "%CI_TAG%"=="" SET CARGO_INCREMENTAL=0
- echo %PATH%
- conan --version
- cmake --version
- rustc -V
- cargo -V
- nasm -v
- conan remove imageflow_c/* -f || exit 0
- cd c_components
- mkdir build || exit 0
- cd build
#- SET PATH=%PATH%;C:\MinGW\bin
- conan install --scope build_tests=True -s compiler="Visual Studio" -o shared=True --build missing -s build_type=Release -s arch=%CONAN_ARCH% -s target_cpu=%TARGET_CPU% -u ../
- conan build ../
- cd ..
- conan remove imageflow_c/* -f
- conan export imazen/testing
- cd %APPVEYOR_BUILD_FOLDER%
- SET RUST_TEST_THREADS=1
- cd imageflow_core
- conan install --build missing -s build_type=Release -s arch=%CONAN_ARCH% -s target_cpu=%TARGET_CPU%
- cd %APPVEYOR_BUILD_FOLDER%
- cargo test --all --release %TARGET_ARG%
- cargo build --all --release %TARGET_ARG%
Expand Down Expand Up @@ -160,7 +138,6 @@ test_script:
- echo. && echo. && echo Cleaning up
- rmdir /q /s .\%TARGET_DIR%doc || exit 0
- rmdir /q /s .\%TARGET_DIR%debug || exit 0
- conan remove imageflow_c/* -f || exit 0
- if NOT "%CI_TAG%"=="" echo Purging build files following %CI_TAG%
- if NOT "%CI_TAG%"=="" rmdir /s /q target || exit 0
- if NOT "%CI_TAG%"=="" rmdir /s /q c_components/build || exit 0
Expand Down
Loading

0 comments on commit 4705447

Please sign in to comment.