Skip to content

Commit

Permalink
Merge pull request #134 from SciTools-incubator/vn0.7.10
Browse files Browse the repository at this point in the history
Vn0.7.10
  • Loading branch information
melissaebrooks authored May 27, 2020
2 parents 3410d6e + 0e1b826 commit 193218a
Show file tree
Hide file tree
Showing 42 changed files with 414 additions and 108 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ should add their details to the [Code Contributors](#code-contributors) section

The following people have contributed to this code under the terms of the Contributor Licence Agreement and Certificate of Origin detailed below:

* Malcolm Brooks (Met Office, UK)
* Melissa Brooks (Met Office, UK)
* Paul Earnshaw (Met Office, UK)

## Contributor Licence Agreement and Certificate of Origin
Expand Down
4 changes: 2 additions & 2 deletions ImageMetaTag/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
a few common image post-processing options are included such as cropping, logo addition and
colour palette manipulation to reduce filesizes.
.. moduleauthor:: Malcolm Brooks https://github.com/malcolmbrooks
.. moduleauthor:: Melissa Brooks https://github.com/melissaebrooks
(C) Crown copyright Met Office. All rights reserved.
Released under BSD 3-Clause License. See LICENSE for more details.
Expand All @@ -25,7 +25,7 @@

# Set constants/properties of ImageMetaTag (before any of it is imported)
# see release_process for details on incrementing the version
__version__ = '0.7.9'
__version__ = '0.7.10'
__documentation__ = 'http://scitools-incubator.github.io/image-meta-tag/build/html/'
# list fo file formats which are valid for saving metadata to:
META_IMG_FORMATS = ['png']
Expand Down
2 changes: 1 addition & 1 deletion ImageMetaTag/img_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
An easy example of creating a webpage, using an ImageDict is shown in
`simplest_image_dict.py <simple.html>`_
.. moduleauthor:: Malcolm Brooks https://github.com/malcolmbrooks
.. moduleauthor:: Melissa Brooks https://github.com/melissaebrooks
(C) Crown copyright Met Office. All rights reserved.
Released under BSD 3-Clause License. See LICENSE for more details.
Expand Down
2 changes: 1 addition & 1 deletion ImageMetaTag/javascript/imt_dropdown.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ImageMetaTag dropdown menu scripting - vn0.7.9
// ImageMetaTag dropdown menu scripting - vn0.7.10
// ImageMetaTag is a python package built around a wrapper for savefig in
// matplotlib, which adds metadata tags to supported image file formats.
// See https://github.com/SciTools-incubator/image-meta-tag for details.
Expand Down
2 changes: 1 addition & 1 deletion ImageMetaTag/savefig.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
basic image manipulation options are included to crop images, add logos and
reduce their file size by simplifying their colour palette.
.. moduleauthor:: Malcolm Brooks https://github.com/malcolmbrooks
.. moduleauthor:: Melissa Brooks https://github.com/melissaebrooks
(C) Crown copyright Met Office. All rights reserved.
Released under BSD 3-Clause License. See LICENSE for more details.
Expand Down
2 changes: 1 addition & 1 deletion ImageMetaTag/webpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
.. TIP:: At present, the only webpage style that can be produced is a set of horizontal dropdown\
menus, but more will hopefully be added soon.
.. moduleauthor:: Malcolm Brooks https://github.com/malcolmbrooks
.. moduleauthor:: Melissa Brooks https://github.com/melissaebrooks
(C) Crown copyright Met Office. All rights reserved.
Released under BSD 3-Clause License. See LICENSE for more details.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Once the images have been tagged, it can also be used to manage an SQL database

As the image metadata tagging process involves reading the image using the Image library, a few common image post-processing options are included such as cropping, logo addition and colour palette manipulation to reduce filesizes.

All ImageMetaTag source code, unless explicitly stated, is © British Crown copyright, 2015-2018 and is released under a [BSD 3-Clause License](LICENSE). Details on how to contribute to ImageMetaTag are given [here](CONTRIBUTING.md).
All ImageMetaTag source code, unless explicitly stated, is © British Crown copyright, 2015-2020 and is released under a [BSD 3-Clause License](LICENSE). Details on how to contribute to ImageMetaTag are given [here](CONTRIBUTING.md).

The file ImageMetaTag/javascript/pako_inflate.js has been copied from [pako](https://github.com/nodeca/pako "pako") and is © 2014-2017 by Vitaly Puzrin and Andrei Tuputcyn and released under a MIT License, detailed within the file.

Expand Down
4 changes: 2 additions & 2 deletions bin/rm_imt_images
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ and http://scitools-incubator.github.io/image-meta-tag/build/html/index.html
This script operates on a ImageMetaTag database file (imt.db in any examples).
Basic example:
rm_imt_images imt.db file.png file2.png
rm_imt_images imt.db file1.png file2.png
this would delete file1.png and file2.png from disk and the imt.db file
Usage with wildcards:
Expand All @@ -30,7 +30,7 @@ Once a database file has been manipulated, and images deleted, any
web pages prepared using the database should be recreated. Doing so is
not part of this script.
.. moduleauthor:: Malcolm Brooks https://github.com/malcolmbrooks
.. moduleauthor:: Melissa Brooks https://github.com/melissaebrooks
(C) Crown copyright Met Office. All rights reserved.
Released under BSD 3-Clause License. See LICENSE for more details.
Expand Down
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/savefig.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/simple.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: cb585ba3c7e942c033b7bd6d5985bd04
config: 2c8c67628c7f3481cd7a248b66a304c3
tags: 645f666f9bcd5a90fca523b33c5a78b7
8 changes: 4 additions & 4 deletions docs/build/html/ImageDict.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ImageMetaTag.ImageDict &#8212; ImageMetaTag 0.7.9 documentation</title>
<title>ImageMetaTag.ImageDict &#8212; ImageMetaTag 0.7.10 documentation</title>
<link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
Expand Down Expand Up @@ -34,7 +34,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="db.html" title="ImageMetaTag.db"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">ImageMetaTag 0.7.9 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">ImageMetaTag 0.7.10 documentation</a> &#187;</li>
</ul>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
Expand Down Expand Up @@ -419,11 +419,11 @@ <h3>Navigation</h3>
<li class="right" >
<a href="db.html" title="ImageMetaTag.db"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">ImageMetaTag 0.7.9 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">ImageMetaTag 0.7.10 documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2015-2018, British Crown Copyright.
&#169; Copyright 2015-2020, British Crown Copyright.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.4.
</div>
</body>
Expand Down
8 changes: 4 additions & 4 deletions docs/build/html/_modules/ImageMetaTag/db.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ImageMetaTag.db &#8212; ImageMetaTag 0.7.9 documentation</title>
<title>ImageMetaTag.db &#8212; ImageMetaTag 0.7.10 documentation</title>
<link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
Expand All @@ -26,7 +26,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">ImageMetaTag 0.7.9 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../index.html">ImageMetaTag 0.7.10 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> &#187;</li>
</ul>
</div>
Expand Down Expand Up @@ -1054,12 +1054,12 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">ImageMetaTag 0.7.9 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../index.html">ImageMetaTag 0.7.10 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Module code</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2015-2018, British Crown Copyright.
&#169; Copyright 2015-2020, British Crown Copyright.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.4.
</div>
</body>
Expand Down
10 changes: 5 additions & 5 deletions docs/build/html/_modules/ImageMetaTag/img_dict.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ImageMetaTag.img_dict &#8212; ImageMetaTag 0.7.9 documentation</title>
<title>ImageMetaTag.img_dict &#8212; ImageMetaTag 0.7.10 documentation</title>
<link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
Expand All @@ -26,7 +26,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">ImageMetaTag 0.7.9 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../index.html">ImageMetaTag 0.7.10 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> &#187;</li>
</ul>
</div>
Expand Down Expand Up @@ -68,7 +68,7 @@ <h1>Source code for ImageMetaTag.img_dict</h1><div class="highlight"><pre>
<span class="sd">An easy example of creating a webpage, using an ImageDict is shown in</span>
<span class="sd">`simplest_image_dict.py &lt;simple.html&gt;`_</span>

<span class="sd">.. moduleauthor:: Malcolm Brooks https://github.com/malcolmbrooks</span>
<span class="sd">.. moduleauthor:: Melissa Brooks https://github.com/melissaebrooks</span>

<span class="sd">(C) Crown copyright Met Office. All rights reserved.</span>
<span class="sd">Released under BSD 3-Clause License. See LICENSE for more details.</span>
Expand Down Expand Up @@ -1065,12 +1065,12 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">ImageMetaTag 0.7.9 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../index.html">ImageMetaTag 0.7.10 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Module code</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2015-2018, British Crown Copyright.
&#169; Copyright 2015-2020, British Crown Copyright.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.4.
</div>
</body>
Expand Down
28 changes: 18 additions & 10 deletions docs/build/html/_modules/ImageMetaTag/savefig.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ImageMetaTag.savefig &#8212; ImageMetaTag 0.7.9 documentation</title>
<title>ImageMetaTag.savefig &#8212; ImageMetaTag 0.7.10 documentation</title>
<link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
Expand All @@ -26,7 +26,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">ImageMetaTag 0.7.9 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../index.html">ImageMetaTag 0.7.10 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> &#187;</li>
</ul>
</div>
Expand Down Expand Up @@ -65,7 +65,7 @@ <h1>Source code for ImageMetaTag.savefig</h1><div class="highlight"><pre>
<span class="sd">basic image manipulation options are included to crop images, add logos and</span>
<span class="sd">reduce their file size by simplifying their colour palette.</span>

<span class="sd">.. moduleauthor:: Malcolm Brooks https://github.com/malcolmbrooks</span>
<span class="sd">.. moduleauthor:: Melissa Brooks https://github.com/melissaebrooks</span>

<span class="sd">(C) Crown copyright Met Office. All rights reserved.</span>
<span class="sd">Released under BSD 3-Clause License. See LICENSE for more details.</span>
Expand All @@ -90,8 +90,7 @@ <h1>Source code for ImageMetaTag.savefig</h1><div class="highlight"><pre>
<span class="n">THUMB_DEFAULT_IMG_SIZE</span> <span class="o">=</span> <span class="mi">150</span><span class="p">,</span> <span class="mi">150</span>
<span class="n">THUMB_DEFAULT_DIR_NAME</span> <span class="o">=</span> <span class="s1">&#39;thumbnail&#39;</span>


<div class="viewcode-block" id="savefig"><a class="viewcode-back" href="../../savefig.html#ImageMetaTag.savefig">[docs]</a><span class="k">def</span> <span class="nf">savefig</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">img_tags</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">img_format</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">img_converter</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
<div class="viewcode-block" id="savefig"><a class="viewcode-back" href="../../savefig.html#ImageMetaTag.savefig">[docs]</a><span class="k">def</span> <span class="nf">savefig</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">fig</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">img_tags</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">img_format</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">img_converter</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
<span class="n">do_trim</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">trim_border</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
<span class="n">do_thumb</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">keep_open</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">dpi</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">logo_file</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">logo_width</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">logo_height</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
Expand All @@ -112,6 +111,7 @@ <h1>Source code for ImageMetaTag.savefig</h1><div class="highlight"><pre>
<span class="sd"> the img_format option)</span>

<span class="sd"> Options:</span>
<span class="sd"> * fig - matplotlib figure to save</span>
<span class="sd"> * img_format - file format of the image. If not supplied it will be \</span>
<span class="sd"> guessed from the filename. Currently only the png file \</span>
<span class="sd"> format is supported for tagging/conversion.</span>
Expand Down Expand Up @@ -158,6 +158,14 @@ <h1>Source code for ImageMetaTag.savefig</h1><div class="highlight"><pre>

<span class="sd"> &#39;&#39;&#39;</span>

<span class="c1"># If fig given then use fig methods, else use pyplot methods</span>
<span class="k">if</span> <span class="n">fig</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">savefig_fn</span> <span class="o">=</span> <span class="n">fig</span><span class="o">.</span><span class="n">savefig</span>
<span class="n">close_fn</span> <span class="o">=</span> <span class="n">fig</span><span class="o">.</span><span class="n">clear</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">savefig_fn</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">savefig</span>
<span class="n">close_fn</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">close</span>

<span class="k">if</span> <span class="n">img_format</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">write_file</span> <span class="o">=</span> <span class="n">filename</span>
<span class="c1"># get the img_format from the end of the filename</span>
Expand Down Expand Up @@ -186,11 +194,11 @@ <h1>Source code for ImageMetaTag.savefig</h1><div class="highlight"><pre>

<span class="c1"># should probably add lots of other args, or use **kwargs</span>
<span class="k">if</span> <span class="n">dpi</span><span class="p">:</span>
<span class="n">plt</span><span class="o">.</span><span class="n">savefig</span><span class="p">(</span><span class="n">savefig_file</span><span class="p">,</span> <span class="n">dpi</span><span class="o">=</span><span class="n">dpi</span><span class="p">)</span>
<span class="n">savefig_fn</span><span class="p">(</span><span class="n">savefig_file</span><span class="p">,</span> <span class="n">dpi</span><span class="o">=</span><span class="n">dpi</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">plt</span><span class="o">.</span><span class="n">savefig</span><span class="p">(</span><span class="n">savefig_file</span><span class="p">)</span>
<span class="n">savefig_fn</span><span class="p">(</span><span class="n">savefig_file</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">keep_open</span><span class="p">:</span>
<span class="n">plt</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
<span class="n">close_fn</span><span class="p">()</span>
<span class="k">if</span> <span class="n">buf</span><span class="p">:</span>
<span class="c1"># need to go to the start of the buffer, if that&#39;s where it went:</span>
<span class="n">buf</span><span class="o">.</span><span class="n">seek</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
Expand Down Expand Up @@ -822,12 +830,12 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">ImageMetaTag 0.7.9 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../index.html">ImageMetaTag 0.7.10 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Module code</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2015-2018, British Crown Copyright.
&#169; Copyright 2015-2020, British Crown Copyright.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.4.
</div>
</body>
Expand Down
Loading

0 comments on commit 193218a

Please sign in to comment.