mirror of
https://github.com/lovell/sharp.git
synced 2025-07-13 12:20:13 +02:00
Improve entropy-based crop docs based on feedback.
Fix includes to keep MSVC compiler happy. Additional memory leak suppressions for latest V8.
This commit is contained in:
parent
2034efcf55
commit
185fcfe635
11
docs/api.md
11
docs/api.md
@ -138,11 +138,14 @@ Possible attributes of `sharp.gravity` are
|
|||||||
`north`, `northeast`, `east`, `southeast`, `south`,
|
`north`, `northeast`, `east`, `southeast`, `south`,
|
||||||
`southwest`, `west`, `northwest`, `center` and `centre`.
|
`southwest`, `west`, `northwest`, `center` and `centre`.
|
||||||
|
|
||||||
`sharp.strategy` currently contains only the experimental `entropy`,
|
Possible attributes of the experimental `sharp.strategy` are:
|
||||||
which will retain the part of the image with the highest
|
|
||||||
[Shannon entropy](https://en.wikipedia.org/wiki/Entropy_%28information_theory%29) value.
|
|
||||||
|
|
||||||
The default option is a `center`/`centre` gravity.
|
* `entropy`: resize so one dimension is at its target size
|
||||||
|
then repeatedly remove pixels from the edge with the lowest
|
||||||
|
[Shannon entropy](https://en.wikipedia.org/wiki/Entropy_%28information_theory%29)
|
||||||
|
until it too reaches the target size.
|
||||||
|
|
||||||
|
The default crop option is a `center`/`centre` gravity.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var transformer = sharp()
|
var transformer = sharp()
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
[#239](https://github.com/lovell/sharp/issues/239)
|
[#239](https://github.com/lovell/sharp/issues/239)
|
||||||
[@chrisriley](https://github.com/chrisriley)
|
[@chrisriley](https://github.com/chrisriley)
|
||||||
|
|
||||||
* Add entropy-based strategy to determine crop region.
|
* Add entropy-based crop strategy to remove least interesting edges.
|
||||||
[#295](https://github.com/lovell/sharp/issues/295)
|
[#295](https://github.com/lovell/sharp/issues/295)
|
||||||
[@rightaway](https://github.com/rightaway)
|
[@rightaway](https://github.com/rightaway)
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#include <algorithm>
|
||||||
|
#include <tuple>
|
||||||
#include <vips/vips8>
|
#include <vips/vips8>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#ifndef SRC_OPERATIONS_H_
|
#ifndef SRC_OPERATIONS_H_
|
||||||
#define SRC_OPERATIONS_H_
|
#define SRC_OPERATIONS_H_
|
||||||
|
|
||||||
|
#include <tuple>
|
||||||
#include <vips/vips8>
|
#include <vips/vips8>
|
||||||
|
|
||||||
using vips::VImage;
|
using vips::VImage;
|
||||||
|
@ -248,6 +248,34 @@
|
|||||||
...
|
...
|
||||||
fun:_ZN2v88internal12_GLOBAL__N_117CreateICUCollatorEPNS0_7IsolateERKN6icu_556LocaleENS0_6HandleINS0_8JSObjectEEE
|
fun:_ZN2v88internal12_GLOBAL__N_117CreateICUCollatorEPNS0_7IsolateERKN6icu_556LocaleENS0_6HandleINS0_8JSObjectEEE
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
leak_v8_CallInterfaceDescriptorData
|
||||||
|
Memcheck:Leak
|
||||||
|
match-leak-kinds: possible
|
||||||
|
...
|
||||||
|
fun:_ZN2v88internal27CallInterfaceDescriptorData26InitializePlatformSpecificEiPNS0_8RegisterEPNS0_27PlatformInterfaceDescriptorE
|
||||||
|
}
|
||||||
|
{
|
||||||
|
leak_v8_InitializePlatformSpecific14
|
||||||
|
Memcheck:Leak
|
||||||
|
match-leak-kinds: possible
|
||||||
|
...
|
||||||
|
fun:_ZN2v88internal14LoadDescriptor26InitializePlatformSpecificEPNS0_27CallInterfaceDescriptorDataE
|
||||||
|
}
|
||||||
|
{
|
||||||
|
leak_v8_InitializePlatformSpecific15
|
||||||
|
Memcheck:Leak
|
||||||
|
match-leak-kinds: possible
|
||||||
|
...
|
||||||
|
fun:_ZN2v88internal15StoreDescriptor26InitializePlatformSpecificEPNS0_27CallInterfaceDescriptorDataE
|
||||||
|
}
|
||||||
|
{
|
||||||
|
leak_v8_Malloced
|
||||||
|
Memcheck:Leak
|
||||||
|
match-leak-kinds: possible
|
||||||
|
...
|
||||||
|
fun:_ZN2v88internal8Malloced3NewEm
|
||||||
|
}
|
||||||
|
|
||||||
# vips__init warnings
|
# vips__init warnings
|
||||||
{
|
{
|
||||||
@ -279,7 +307,7 @@
|
|||||||
fun:vips__magick_read_header
|
fun:vips__magick_read_header
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
cond_magick_is_palette_image
|
cond_magick_is_palette_image_get_bands
|
||||||
Memcheck:Cond
|
Memcheck:Cond
|
||||||
fun:IsPaletteImage
|
fun:IsPaletteImage
|
||||||
...
|
...
|
||||||
@ -292,6 +320,13 @@
|
|||||||
...
|
...
|
||||||
fun:get_bands
|
fun:get_bands
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
cond_magick_is_palette_image_parse_header
|
||||||
|
Memcheck:Cond
|
||||||
|
fun:IsPaletteImage
|
||||||
|
...
|
||||||
|
fun:parse_header
|
||||||
|
}
|
||||||
|
|
||||||
# glib g_file_read_link
|
# glib g_file_read_link
|
||||||
# https://github.com/GNOME/glib/commit/49a5d0f6f2aed99cd78f25655f137f4448e47d92
|
# https://github.com/GNOME/glib/commit/49a5d0f6f2aed99cd78f25655f137f4448e47d92
|
||||||
|
Loading…
x
Reference in New Issue
Block a user