When a focal point matches the size of the image, the crop sizes are
also the same.
These sizes are subtracted from each other in the fill filter
(which would equal zero) and this number then gets used as the
denominator in a division causing the ZeroDivisionError to be raised.
The fix is simple, don't do any crop closeness calculations if the focal
point size equals the image size. Crop closeness wouldn't work anyway in
this case
When the FocalPoint class was removed, detect_features was updated to return tuples.
This commit fixes a typo where the x and y attributes were still being accessed as attributes.
Previously, an image served to an external site was rendered on the fly.
This may have performance issues with large websites.
This commit changes the image serve view to use renditions so images are
only rendered when the url is first accessed. When the user hits the
url, they are now given a permanent redirect to the renditions image.
IE9 doesn't support conditional comments so testing "if IE 9" would always be false. Additionally this also meant no HTML tag was actually output for any other browser either! As we don't support IE8 either, testing for IE8 was also pointless.
Previously, we used a property to do this. Heres the advantages of the
new way:
- The old way felt a bit like it was pretending to be a database field
when it wasn't. The new way makes it easier for the developer to
understand that this is just a setter/getter for 4 fields and not a
field itself.
- Code looks nicer
- Easier to override in subclasses
- More like Django user model
When a field uses the partial matching, the edgengram_analyser is added
to that field.
This breaks down the field data into "ngrams" like so:
Hello -> "H", "He", "Hel", "Hell", "Hello"
This allows a users query for "Hel" to match the above text.
The issue that this commit solves is that this was accidentally set as
both the index analyser (as described above) and also the query
analyser.
Setting this as the query analyser will instruct Elasticsearch to
perform the above transformation on the users input to the box as well.
So if, for example, there was a document with the word "Horse" in it, a
users query for "Hello" will match this simply because they both start
with the letter "H".
The solution is to simply set the "index_analyser" instead of the
"analyser" field (which will sets "query_analyser" as well).