diff --git a/exifsamples/Landscape_0.jpg b/exifsamples/Landscape_0.jpg new file mode 100644 index 0000000000..0da16ebb58 Binary files /dev/null and b/exifsamples/Landscape_0.jpg differ diff --git a/exifsamples/Landscape_1.jpg b/exifsamples/Landscape_1.jpg new file mode 100644 index 0000000000..d6eda8dd99 Binary files /dev/null and b/exifsamples/Landscape_1.jpg differ diff --git a/exifsamples/Landscape_2.jpg b/exifsamples/Landscape_2.jpg new file mode 100644 index 0000000000..10369e8b98 Binary files /dev/null and b/exifsamples/Landscape_2.jpg differ diff --git a/exifsamples/Landscape_3.jpg b/exifsamples/Landscape_3.jpg new file mode 100644 index 0000000000..842b827f3a Binary files /dev/null and b/exifsamples/Landscape_3.jpg differ diff --git a/exifsamples/Landscape_4.jpg b/exifsamples/Landscape_4.jpg new file mode 100644 index 0000000000..c58d01d247 Binary files /dev/null and b/exifsamples/Landscape_4.jpg differ diff --git a/exifsamples/Landscape_5.jpg b/exifsamples/Landscape_5.jpg new file mode 100644 index 0000000000..1828accb9a Binary files /dev/null and b/exifsamples/Landscape_5.jpg differ diff --git a/exifsamples/Landscape_6.jpg b/exifsamples/Landscape_6.jpg new file mode 100644 index 0000000000..1bfa104789 Binary files /dev/null and b/exifsamples/Landscape_6.jpg differ diff --git a/exifsamples/Landscape_7.jpg b/exifsamples/Landscape_7.jpg new file mode 100644 index 0000000000..4604536d5c Binary files /dev/null and b/exifsamples/Landscape_7.jpg differ diff --git a/exifsamples/Landscape_8.jpg b/exifsamples/Landscape_8.jpg new file mode 100644 index 0000000000..bdb72e57c4 Binary files /dev/null and b/exifsamples/Landscape_8.jpg differ diff --git a/exifsamples/Portrait_0.jpg b/exifsamples/Portrait_0.jpg new file mode 100644 index 0000000000..55e3d3d9b6 Binary files /dev/null and b/exifsamples/Portrait_0.jpg differ diff --git a/exifsamples/Portrait_1.jpg b/exifsamples/Portrait_1.jpg new file mode 100644 index 0000000000..9e2265ea64 Binary files /dev/null and b/exifsamples/Portrait_1.jpg differ diff --git a/exifsamples/Portrait_2.jpg b/exifsamples/Portrait_2.jpg new file mode 100644 index 0000000000..e6659cf236 Binary files /dev/null and b/exifsamples/Portrait_2.jpg differ diff --git a/exifsamples/Portrait_3.jpg b/exifsamples/Portrait_3.jpg new file mode 100644 index 0000000000..b6677a0bc4 Binary files /dev/null and b/exifsamples/Portrait_3.jpg differ diff --git a/exifsamples/Portrait_4.jpg b/exifsamples/Portrait_4.jpg new file mode 100644 index 0000000000..a30ebcd7c9 Binary files /dev/null and b/exifsamples/Portrait_4.jpg differ diff --git a/exifsamples/Portrait_5.jpg b/exifsamples/Portrait_5.jpg new file mode 100644 index 0000000000..81903adbf3 Binary files /dev/null and b/exifsamples/Portrait_5.jpg differ diff --git a/exifsamples/Portrait_6.jpg b/exifsamples/Portrait_6.jpg new file mode 100644 index 0000000000..aa208a8c84 Binary files /dev/null and b/exifsamples/Portrait_6.jpg differ diff --git a/exifsamples/Portrait_7.jpg b/exifsamples/Portrait_7.jpg new file mode 100644 index 0000000000..59336f3802 Binary files /dev/null and b/exifsamples/Portrait_7.jpg differ diff --git a/exifsamples/Portrait_8.jpg b/exifsamples/Portrait_8.jpg new file mode 100644 index 0000000000..de16d061b0 Binary files /dev/null and b/exifsamples/Portrait_8.jpg differ diff --git a/library/test/build.gradle b/library/test/build.gradle index 1c8198616f..a3ceadf5b0 100644 --- a/library/test/build.gradle +++ b/library/test/build.gradle @@ -55,10 +55,10 @@ android { sourceSets { androidTest { - resources.srcDirs += ['../../third_party/exif_orientation_examples'] + resources.srcDirs += ['../../exifsamples'] } test { - resources.srcDirs += ['../../third_party/exif_orientation_examples'] + resources.srcDirs += ['../../exifsamples'] } } } diff --git a/third_party/exif_orientation_examples/.gitignore b/third_party/exif_orientation_examples/.gitignore deleted file mode 100644 index f39f9657ce..0000000000 --- a/third_party/exif_orientation_examples/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/.ruby-gemset -/.ruby-version -/generator/Gemfile.lock -/Landscape.jpg -/Portrait.jpg -/sources diff --git a/third_party/exif_orientation_examples/LICENSE b/third_party/exif_orientation_examples/LICENSE deleted file mode 100644 index 978ee2ae82..0000000000 --- a/third_party/exif_orientation_examples/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010 Dave Perrett, http://recursive-design.com/ - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/third_party/exif_orientation_examples/Landscape_1.jpg b/third_party/exif_orientation_examples/Landscape_1.jpg deleted file mode 100644 index fda188236a..0000000000 Binary files a/third_party/exif_orientation_examples/Landscape_1.jpg and /dev/null differ diff --git a/third_party/exif_orientation_examples/Landscape_2.jpg b/third_party/exif_orientation_examples/Landscape_2.jpg deleted file mode 100644 index d2605f81b9..0000000000 Binary files a/third_party/exif_orientation_examples/Landscape_2.jpg and /dev/null differ diff --git a/third_party/exif_orientation_examples/Landscape_3.jpg b/third_party/exif_orientation_examples/Landscape_3.jpg deleted file mode 100644 index f508052340..0000000000 Binary files a/third_party/exif_orientation_examples/Landscape_3.jpg and /dev/null differ diff --git a/third_party/exif_orientation_examples/Landscape_4.jpg b/third_party/exif_orientation_examples/Landscape_4.jpg deleted file mode 100644 index d73dee8fd7..0000000000 Binary files a/third_party/exif_orientation_examples/Landscape_4.jpg and /dev/null differ diff --git a/third_party/exif_orientation_examples/Landscape_5.jpg b/third_party/exif_orientation_examples/Landscape_5.jpg deleted file mode 100644 index 975d858838..0000000000 Binary files a/third_party/exif_orientation_examples/Landscape_5.jpg and /dev/null differ diff --git a/third_party/exif_orientation_examples/Landscape_6.jpg b/third_party/exif_orientation_examples/Landscape_6.jpg deleted file mode 100644 index b579b7f9ab..0000000000 Binary files a/third_party/exif_orientation_examples/Landscape_6.jpg and /dev/null differ diff --git a/third_party/exif_orientation_examples/Landscape_7.jpg b/third_party/exif_orientation_examples/Landscape_7.jpg deleted file mode 100644 index b1e919cfd9..0000000000 Binary files a/third_party/exif_orientation_examples/Landscape_7.jpg and /dev/null differ diff --git a/third_party/exif_orientation_examples/Landscape_8.jpg b/third_party/exif_orientation_examples/Landscape_8.jpg deleted file mode 100644 index c381db10e6..0000000000 Binary files a/third_party/exif_orientation_examples/Landscape_8.jpg and /dev/null differ diff --git a/third_party/exif_orientation_examples/Makefile b/third_party/exif_orientation_examples/Makefile deleted file mode 100644 index c5fc2e0e4c..0000000000 --- a/third_party/exif_orientation_examples/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -all: portrait landscape - -portrait: - curl --location https://source.unsplash.com/random/1200x1600 --output ./Portrait.jpg - bash -c "cd generator && ./generate.rb ../Portrait.jpg" - rm -f ./Portrait.jpg - -landscape: - curl --location https://source.unsplash.com/random/1600x1200 --output ./Landscape.jpg - bash -c "cd generator && ./generate.rb ../Landscape.jpg" - rm -f ./Landscape.jpg diff --git a/third_party/exif_orientation_examples/Portrait_1.jpg b/third_party/exif_orientation_examples/Portrait_1.jpg deleted file mode 100644 index dcb57c537f..0000000000 Binary files a/third_party/exif_orientation_examples/Portrait_1.jpg and /dev/null differ diff --git a/third_party/exif_orientation_examples/Portrait_2.jpg b/third_party/exif_orientation_examples/Portrait_2.jpg deleted file mode 100644 index 8c3adf7afb..0000000000 Binary files a/third_party/exif_orientation_examples/Portrait_2.jpg and /dev/null differ diff --git a/third_party/exif_orientation_examples/Portrait_3.jpg b/third_party/exif_orientation_examples/Portrait_3.jpg deleted file mode 100644 index 5a5544f233..0000000000 Binary files a/third_party/exif_orientation_examples/Portrait_3.jpg and /dev/null differ diff --git a/third_party/exif_orientation_examples/Portrait_4.jpg b/third_party/exif_orientation_examples/Portrait_4.jpg deleted file mode 100644 index 9eb2a6a1e6..0000000000 Binary files a/third_party/exif_orientation_examples/Portrait_4.jpg and /dev/null differ diff --git a/third_party/exif_orientation_examples/Portrait_5.jpg b/third_party/exif_orientation_examples/Portrait_5.jpg deleted file mode 100644 index 905169aa75..0000000000 Binary files a/third_party/exif_orientation_examples/Portrait_5.jpg and /dev/null differ diff --git a/third_party/exif_orientation_examples/Portrait_6.jpg b/third_party/exif_orientation_examples/Portrait_6.jpg deleted file mode 100644 index 8fc576e067..0000000000 Binary files a/third_party/exif_orientation_examples/Portrait_6.jpg and /dev/null differ diff --git a/third_party/exif_orientation_examples/Portrait_7.jpg b/third_party/exif_orientation_examples/Portrait_7.jpg deleted file mode 100644 index cfa04d66e0..0000000000 Binary files a/third_party/exif_orientation_examples/Portrait_7.jpg and /dev/null differ diff --git a/third_party/exif_orientation_examples/Portrait_8.jpg b/third_party/exif_orientation_examples/Portrait_8.jpg deleted file mode 100644 index b2a50d6eb6..0000000000 Binary files a/third_party/exif_orientation_examples/Portrait_8.jpg and /dev/null differ diff --git a/third_party/exif_orientation_examples/README.markdown b/third_party/exif_orientation_examples/README.markdown deleted file mode 100644 index 61c0b85955..0000000000 --- a/third_party/exif_orientation_examples/README.markdown +++ /dev/null @@ -1,82 +0,0 @@ -EXIF Orientation-flag example images -==================================== - -Example images using each of the EXIF orientation flags (1-to-8), in both landscape and portrait orientations. - -[See here](http://www.daveperrett.com/articles/2012/07/28/exif-orientation-handling-is-a-ghetto/) for more information. - - -Generating your own images --------------------------- - -If you would like to generate test images based on your own photos, you can use the `generate.rb` script included in the `generator` folder. - -The instructions below assume you are running on OSX - if not, you will need to install the Ghostscript fonts (`brew install gs`) some other way. - -To install the dependencies: - -``` -> brew install gs -> cd generator -> gem install bundler -> bundle install -``` - -To generate test images: - -``` -> cd generator -> ./generate path/to/image.jpg -``` - -This will create images `image_1.jpg` through to `image_8.jpg`. - - -Re-generating sample images ---------------------------- - -Simply run `make` to regenerate the included sample images. This will download random portrait and landscape orientation images from [unsplash.com](https://unsplash.com/) and generate sample images for each of them. - -Generating these images depends on having the generator dependencies installed - see the *Generating your own images* section for instructions on installing dependencies. - - -Credits -------- - -* The sample landscape image is by [Pierre Bouillot](https://unsplash.com/photos/v15iOM6pWgI). -* The sample portrait image is by [John Salvino](https://unsplash.com/photos/1PPpwrTNkJI). - - -Change history --------------- - -* **Version 2.0.0 (2017-08-05)** : Add a script to generate example images from the command line. -* **Version 1.0.2 (2017-03-06)** : Remove Apple Copyrighted ICC profile from orientations 2-8 (thanks @mans0954!). -* **Version 1.0.1 (2013-03-10)** : Add MIT license and some contact details. -* **Version 1.0.0 (2012-07-28)** : 1.0 release. - - -Contributing ------------- - -Once you've made your commits: - -1. [Fork](http://help.github.com/fork-a-repo/) exif-orientation-examples -2. Create a topic branch - `git checkout -b my_branch` -3. Push to your branch - `git push origin my_branch` -4. Create a [Pull Request](http://help.github.com/pull-requests/) from your branch -5. That's it! - - -Author ------- - -Dave Perrett :: hello@daveperrett.com :: [@daveperrett](http://twitter.com/daveperrett) - - -Copyright ---------- - -These images are licensed under the [MIT License](http://opensource.org/licenses/MIT). - -Copyright (c) 2010 Dave Perrett. See [License](https://github.com/recurser/exif-orientation-examples/blob/master/LICENSE) for details. diff --git a/third_party/exif_orientation_examples/README.third_party b/third_party/exif_orientation_examples/README.third_party deleted file mode 100644 index e27da75624..0000000000 --- a/third_party/exif_orientation_examples/README.third_party +++ /dev/null @@ -1,10 +0,0 @@ -URL: https://github.com/recurser/exif-orientation-examples/tree/d06cd11258b98b24b3cd8d391ee5bf4961a80853 -Version: d06cd11258b98b24b3cd8d391ee5bf4961a80853 -License: MIT -License File: LICENSE - -Description: -Sample images with all of the supported exif orientations. - -Local Modifications: -None diff --git a/third_party/exif_orientation_examples/VERSION b/third_party/exif_orientation_examples/VERSION deleted file mode 100644 index 227cea2156..0000000000 --- a/third_party/exif_orientation_examples/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.0.0 diff --git a/third_party/exif_orientation_examples/generator/Gemfile b/third_party/exif_orientation_examples/generator/Gemfile deleted file mode 100644 index 65e8f880b0..0000000000 --- a/third_party/exif_orientation_examples/generator/Gemfile +++ /dev/null @@ -1,4 +0,0 @@ -source 'https://rubygems.org' -ruby '2.4.1' - -gem 'rmagick' diff --git a/third_party/exif_orientation_examples/generator/generate.rb b/third_party/exif_orientation_examples/generator/generate.rb deleted file mode 100755 index 4df576670e..0000000000 --- a/third_party/exif_orientation_examples/generator/generate.rb +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env ruby - -# Make sure to 'brew install gs' before running this. - -require 'RMagick' -require 'tempfile' - -if ARGV.length != 1 - abort "Usage: #{$PROGRAM_NAME} /path/to/image" -end - -# Make sure the file exists. -source = ARGV[0] -abort "Error: File '#{source}' not found" unless File.exist?(source) && File.file?(source) - -# Copy it to the temp directory. -path = Tempfile.new('to-convert').path -FileUtils.cp source, path - -# Make sure it's an image. -image = begin - Magick::Image::read(path).first -rescue Magick::ImageMagickError - abort "Error: File '#{source}' does not appear to be an image." -end - -# Make sure exiftool and convert are available. -abort 'Error: The exiftool command does not appear to be available' if `which exiftool` == '' -abort 'Error: The convert command does not appear to be available' if `which convert` == '' -abort 'Error: the input file must be a JPEG' unless image.format == 'JPEG' - -# Decide where we'll put the output. -dest_folder = File.dirname(source) -dest_file_base = File.basename(source, '.*') -dest_extention = File.extname(source) - -# Strip all exif data. -`exiftool -all= #{path}` - -# Strip color profile info. -FileUtils.cp path, "#{path}.convert" -`convert #{path}.convert +profile "*" #{path}` -FileUtils.rm_f "#{path}.convert" - -# Decide on a suitable font size. -dimension = [image.rows, image.columns].max -font_size = dimension / 20 - -# Add top / right / bottom / left text. -text = Magick::Draw.new -text.font_family = 'helvetica' -text.pointsize = font_size -text.fill = 'white' -text.stroke = 'black' -text.stroke_width = 1 -edge_padding = font_size / 4 - -text.annotate(image, 0, 0, 0, edge_padding, 'top') do - self.gravity = Magick::NorthGravity -end - -text.annotate(image, 0, 0, 0, edge_padding, 'bottom') do - self.gravity = Magick::SouthGravity -end - -text.annotate(image, 0, 0, edge_padding, 0, 'right') do - self.gravity = Magick::EastGravity -end - -text.annotate(image, 0, 0, edge_padding, 0, 'left') do - self.gravity = Magick::WestGravity -end - -transformations = [ - { - exif_tag: 1, - rotation_degrees: 0, - flop: false, - }, - { - exif_tag: 2, - rotation_degrees: 0, - flop: true, - }, - - { - exif_tag: 3, - rotation_degrees: 180, - flop: false, - }, - { - exif_tag: 4, - rotation_degrees: 180, - flop: true, - }, - { - exif_tag: 5, - rotation_degrees: -90, - flop: true, - }, - { - exif_tag: 6, - rotation_degrees: -90, - flop: false, - }, - { - exif_tag: 7, - rotation_degrees: 90, - flop: true, - }, - { - exif_tag: 8, - rotation_degrees: 90, - flop: false, - }, -] - -transformations.each do |t| - tmp_image = image.dup - - # Add centered text displaying the orientation tag number. - text.annotate(tmp_image, 0, 0, 0, 0, t[:exif_tag].to_s) do - self.gravity = Magick::CenterGravity - text.pointsize = font_size * 2 - end - - # Rotate and transform the image. - tmp_image.flop! if t[:flop] - tmp_image.rotate! t[:rotation_degrees] if t[:rotation_degrees] != 0 - out_path = File.join(dest_folder, "#{dest_file_base}_#{t[:exif_tag]}#{dest_extention}") - tmp_image.write(out_path) - - # Set the EXIF Orientation tag. - `exiftool -overwrite_original -orientation=#{t[:exif_tag]} -n #{out_path}` -end