<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/odoo/tools/image.py, branch 14.0</title>
<subtitle>The current checkout of upstream Odoo</subtitle>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/'/>
<entry>
<title>[FIX] tools: prevent call to pillow exif_transpose image method</title>
<updated>2021-02-09T11:32:23+00:00</updated>
<author>
<name>Christophe Monniez</name>
<email>moc@odoo.com</email>
</author>
<published>2021-02-05T16:55:21+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=bfd3f857b44f31f8077182d10cab869f42076464'/>
<id>bfd3f857b44f31f8077182d10cab869f42076464</id>
<content type='text'>
In a previous fix [0], the call to exif_transpose was kept to allow
rotation of images format different than `JPEG`.

After a small test, it appeared that the call would crash if the image
in another format had the same `LensInfo` tag.
So it's safer to not call this method at all.

With this commit, the rotation tag is retrieved disregarding the file
format by using the `getexif` method if available, falling back to the
private method for Pillow &lt; 6 support.

As a bonus, a test is also added with a small embedded `JPEG` image,
crafted with an `Orientation` exif tag and, for reference,  the
`LensInfo`tag that caused so much trouble.

The fix referenced in [0] was not forward-ported as it was only moving
the code the is completely removed in the present.

[0] b83c48d5c48954193

closes odoo/odoo#65793

X-original-commit: 38f696dfa5134d93b5a3a1c0647aa8f8c1bd18c9
Signed-off-by: Christophe Monniez (moc) &lt;moc@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In a previous fix [0], the call to exif_transpose was kept to allow
rotation of images format different than `JPEG`.

After a small test, it appeared that the call would crash if the image
in another format had the same `LensInfo` tag.
So it's safer to not call this method at all.

With this commit, the rotation tag is retrieved disregarding the file
format by using the `getexif` method if available, falling back to the
private method for Pillow &lt; 6 support.

As a bonus, a test is also added with a small embedded `JPEG` image,
crafted with an `Orientation` exif tag and, for reference,  the
`LensInfo`tag that caused so much trouble.

The fix referenced in [0] was not forward-ported as it was only moving
the code the is completely removed in the present.

[0] b83c48d5c48954193

closes odoo/odoo#65793

X-original-commit: 38f696dfa5134d93b5a3a1c0647aa8f8c1bd18c9
Signed-off-by: Christophe Monniez (moc) &lt;moc@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] *: replace to new _() syntax</title>
<updated>2020-06-18T11:03:34+00:00</updated>
<author>
<name>Martin Trigaux</name>
<email>mat@odoo.com</email>
</author>
<published>2020-06-04T10:39:11+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=ba244cef01132347df4d2d9553ea3105ba13a938'/>
<id>ba244cef01132347df4d2d9553ea3105ba13a938</id>
<content type='text'>
Using a few regex like
\((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\)
($1, $3))

Old syntax is still compatible but starts the migration to the new
syntax that catches error.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using a few regex like
\((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\)
($1, $3))

Old syntax is still compatible but starts the migration to the new
syntax that catches error.
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] tools, base: fix orientation of image with EXIF orientation tag</title>
<updated>2019-10-14T13:03:03+00:00</updated>
<author>
<name>Sébastien Theys</name>
<email>seb@odoo.com</email>
</author>
<published>2019-10-11T16:38:55+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=3c3f0753da26d8e6df522f795501e2686852709c'/>
<id>3c3f0753da26d8e6df522f795501e2686852709c</id>
<content type='text'>
Before this commit, some images would display incorrectly orientated.

This typically happens for images taken from a non-standard orientation
by some phones or other devices that are able to report orientation.

The specified transposition is applied to the image before all other
operations, because all of them expect the image to be in its final
orientation, which is the case only when the first row of pixels is the top
of the image and the first column of pixels is the left of the image.

Moreover the EXIF tags will not be kept when the image is later saved, so
the transposition has to be done to ensure the final image is correctly
orientated.

closes odoo/odoo#38717

X-original-commit: 0f8e132ec0495fcdfa0a47d5b9c98a2f6f10c7d8
Signed-off-by: Sébastien Theys (seb) &lt;seb@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit, some images would display incorrectly orientated.

This typically happens for images taken from a non-standard orientation
by some phones or other devices that are able to report orientation.

The specified transposition is applied to the image before all other
operations, because all of them expect the image to be in its final
orientation, which is the case only when the first row of pixels is the top
of the image and the first column of pixels is the left of the image.

Moreover the EXIF tags will not be kept when the image is later saved, so
the transposition has to be done to ensure the final image is correctly
orientated.

closes odoo/odoo#38717

X-original-commit: 0f8e132ec0495fcdfa0a47d5b9c98a2f6f10c7d8
Signed-off-by: Sébastien Theys (seb) &lt;seb@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] tools: use user friendly message in case of error</title>
<updated>2019-09-18T10:14:12+00:00</updated>
<author>
<name>RomainLibert</name>
<email>rli@odoo.com</email>
</author>
<published>2019-09-18T09:17:17+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=85eeaccf065b151dbc9f0e1a24f1b4f674dec6cc'/>
<id>85eeaccf065b151dbc9f0e1a24f1b4f674dec6cc</id>
<content type='text'>
closes odoo/odoo#37058

Signed-off-by: Nans Lefebvre (len) &lt;len@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
closes odoo/odoo#37058

Signed-off-by: Nans Lefebvre (len) &lt;len@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] tools: crop &amp; resize image crashes</title>
<updated>2019-09-25T15:12:46+00:00</updated>
<author>
<name>fw-bot</name>
<email>otis@odoo.com</email>
</author>
<published>2019-09-25T14:59:05+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=c8d09167fdb44b6fb824705d3d9103903edc23ee'/>
<id>c8d09167fdb44b6fb824705d3d9103903edc23ee</id>
<content type='text'>
- When trying to access an image that need to be resized and cropped,
  the code could crashes.

  This is due to the fact that PIL expect to work with integer for
  sizes, but in some cases we provide floats

closes odoo/odoo#37442

Signed-off-by: Toufik Benjaa (tbe) &lt;tbe@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- When trying to access an image that need to be resized and cropped,
  the code could crashes.

  This is due to the fact that PIL expect to work with integer for
  sizes, but in some cases we provide floats

closes odoo/odoo#37442

Signed-off-by: Toufik Benjaa (tbe) &lt;tbe@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] tools, product, website_sale: rename image_variant_max</title>
<updated>2019-08-06T12:29:13+00:00</updated>
<author>
<name>Sébastien Theys</name>
<email>seb@odoo.com</email>
</author>
<published>2019-08-06T12:23:43+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=67e3924bfe49411a4d9cac04327a6d8c9afe869a'/>
<id>67e3924bfe49411a4d9cac04327a6d8c9afe869a</id>
<content type='text'>
Follow up of 58a2ffa26f1a3b0f9630ce16d11b758d18e20a21

Variant specific field `image_raw_original` was meant to be renamed to
`image_variant_1920` instead of `image_variant_max` to follow the same naming
convention as the other fields (having the pixel number in the name).

closes odoo/odoo#35493

Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow up of 58a2ffa26f1a3b0f9630ce16d11b758d18e20a21

Variant specific field `image_raw_original` was meant to be renamed to
`image_variant_1920` instead of `image_variant_max` to follow the same naming
convention as the other fields (having the pixel number in the name).

closes odoo/odoo#35493

Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] tools: fix condition of image_process quick return</title>
<updated>2019-08-06T12:16:18+00:00</updated>
<author>
<name>Sébastien Theys</name>
<email>seb@odoo.com</email>
</author>
<published>2019-08-06T11:53:46+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=b77bbd01f8f746afb49239abc28a4bd543528917'/>
<id>b77bbd01f8f746afb49239abc28a4bd543528917</id>
<content type='text'>
Follow up of 344614b54a2aa7799a551306b31c00f52ed4f999

If base64_source is falsy, we don't need to check the other parameters.

closes odoo/odoo#35489

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow up of 344614b54a2aa7799a551306b31c00f52ed4f999

If base64_source is falsy, we don't need to check the other parameters.

closes odoo/odoo#35489

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] tools, base: removed unused image helpers</title>
<updated>2019-08-02T16:47:58+00:00</updated>
<author>
<name>Sébastien Theys</name>
<email>seb@odoo.com</email>
</author>
<published>2019-08-01T11:20:58+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=45e3be94c0095b0814690de3cac9ab56afe32368'/>
<id>45e3be94c0095b0814690de3cac9ab56afe32368</id>
<content type='text'>
PR: #34925</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR: #34925</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] base, product, website_sale: move image zoom out of mixin</title>
<updated>2019-08-02T16:47:58+00:00</updated>
<author>
<name>Sébastien Theys</name>
<email>seb@odoo.com</email>
</author>
<published>2019-08-01T11:20:36+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=1b85ab93ec647ed723dd72d11df7b3c8283d5f98'/>
<id>1b85ab93ec647ed723dd72d11df7b3c8283d5f98</id>
<content type='text'>
This field is not necessary on most models so move it to the few places where it
is needed to avoid computing it and storing it everywhere.

PR: #34925</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This field is not necessary on most models so move it to the few places where it
is needed to avoid computing it and storing it everywhere.

PR: #34925</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] *: rename image fields</title>
<updated>2019-08-02T16:47:58+00:00</updated>
<author>
<name>Sébastien Theys</name>
<email>seb@odoo.com</email>
</author>
<published>2019-08-01T11:20:33+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=58a2ffa26f1a3b0f9630ce16d11b758d18e20a21'/>
<id>58a2ffa26f1a3b0f9630ce16d11b758d18e20a21</id>
<content type='text'>
image_original =&gt; image_1920 (now resized to 1920)
image_big =&gt; image_1024
image_large =&gt; image_256
image_medium =&gt; image_128
image_small  =&gt; image_64
image replaced by image_1920 (when writing) or by image_1024 (when displaying
	what was previously the big size)

+ add new intermediate format:
image_512

PR: #34925</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
image_original =&gt; image_1920 (now resized to 1920)
image_big =&gt; image_1024
image_large =&gt; image_256
image_medium =&gt; image_128
image_small  =&gt; image_64
image replaced by image_1920 (when writing) or by image_1024 (when displaying
	what was previously the big size)

+ add new intermediate format:
image_512

PR: #34925</pre>
</div>
</content>
</entry>
</feed>
