mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Tighten C++ linting rules
Bump benchmark dependencies Update leak test suppressions Update future branch details
This commit is contained in:
parent
24fb0c33c2
commit
c66495b66c
@ -41,9 +41,9 @@ Any change that modifies the existing public API should be added to the relevant
|
||||
|
||||
| Release | WIP branch |
|
||||
| ------: | :--------- |
|
||||
| v0.14.0 | needle |
|
||||
| v0.15.0 | outfit |
|
||||
| v0.16.0 | pencil |
|
||||
| v0.17.0 | quill |
|
||||
|
||||
Please squash your changes into a single commit using a command like `git rebase -i upstream/<wip-branch>`.
|
||||
|
||||
|
@ -8,16 +8,16 @@
|
||||
// Verify platform and compiler compatibility
|
||||
|
||||
#if (VIPS_MAJOR_VERSION < 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 2))
|
||||
#error libvips version 8.2.0+ required - see http://sharp.dimens.io/page/install
|
||||
#error libvips version 8.2.0+ required - see sharp.dimens.io/page/install
|
||||
#endif
|
||||
|
||||
#if ((!defined(__clang__)) && defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)))
|
||||
#error GCC version 4.6+ is required for C++11 features - see http://sharp.dimens.io/page/install#prerequisites
|
||||
#error GCC version 4.6+ is required for C++11 features - see sharp.dimens.io/page/install#prerequisites
|
||||
#endif
|
||||
|
||||
#if (defined(__clang__) && defined(__has_feature))
|
||||
#if (!__has_feature(cxx_range_for))
|
||||
#error clang version 3.0+ is required for C++11 features - see http://sharp.dimens.io/page/install#prerequisites
|
||||
#error clang version 3.0+ is required for C++11 features - see sharp.dimens.io/page/install#prerequisites
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -219,31 +219,40 @@ namespace sharp {
|
||||
int left = 0;
|
||||
int top = 0;
|
||||
switch (gravity) {
|
||||
case 1: // North
|
||||
case 1:
|
||||
// North
|
||||
left = (inWidth - outWidth + 1) / 2;
|
||||
break;
|
||||
case 2: // East
|
||||
case 2:
|
||||
// East
|
||||
left = inWidth - outWidth;
|
||||
top = (inHeight - outHeight + 1) / 2;
|
||||
break;
|
||||
case 3: // South
|
||||
case 3:
|
||||
// South
|
||||
left = (inWidth - outWidth + 1) / 2;
|
||||
top = inHeight - outHeight;
|
||||
break;
|
||||
case 4: // West
|
||||
case 4:
|
||||
// West
|
||||
top = (inHeight - outHeight + 1) / 2;
|
||||
break;
|
||||
case 5: // Northeast
|
||||
case 5:
|
||||
// Northeast
|
||||
left = inWidth - outWidth;
|
||||
break;
|
||||
case 6: // Southeast
|
||||
case 6:
|
||||
// Southeast
|
||||
left = inWidth - outWidth;
|
||||
top = inHeight - outHeight;
|
||||
case 7: // Southwest
|
||||
case 7:
|
||||
// Southwest
|
||||
top = inHeight - outHeight;
|
||||
case 8: // Northwest
|
||||
case 8:
|
||||
// Northwest
|
||||
break;
|
||||
default: // Centre
|
||||
default:
|
||||
// Centre
|
||||
left = (inWidth - outWidth + 1) / 2;
|
||||
top = (inHeight - outHeight + 1) / 2;
|
||||
}
|
||||
|
@ -73,7 +73,6 @@ struct MetadataBaton {
|
||||
};
|
||||
|
||||
class MetadataWorker : public AsyncWorker {
|
||||
|
||||
public:
|
||||
MetadataWorker(Callback *callback, MetadataBaton *baton, const Local<Object> &bufferIn) :
|
||||
AsyncWorker(callback), baton(baton) {
|
||||
|
@ -71,7 +71,6 @@ using sharp::counterProcess;
|
||||
using sharp::counterQueue;
|
||||
|
||||
class PipelineWorker : public AsyncWorker {
|
||||
|
||||
public:
|
||||
PipelineWorker(Callback *callback, PipelineBaton *baton, Callback *queueListener,
|
||||
const Local<Object> &bufferIn, const Local<Object> &overlayBufferIn) :
|
||||
@ -89,7 +88,6 @@ class PipelineWorker : public AsyncWorker {
|
||||
libuv worker
|
||||
*/
|
||||
void Execute() {
|
||||
|
||||
// Decrement queued task counter
|
||||
g_atomic_int_dec_and_test(&counterQueue);
|
||||
// Increment processing task counter
|
||||
@ -685,7 +683,8 @@ class PipelineWorker : public AsyncWorker {
|
||||
->set("strip", !baton->withMetadata)
|
||||
->set("compression", baton->compressionLevel)
|
||||
->set("interlace", baton->progressive)
|
||||
->set("filter", baton->withoutAdaptiveFiltering ? VIPS_FOREIGN_PNG_FILTER_NONE : VIPS_FOREIGN_PNG_FILTER_ALL)
|
||||
->set("filter", baton->withoutAdaptiveFiltering ?
|
||||
VIPS_FOREIGN_PNG_FILTER_NONE : VIPS_FOREIGN_PNG_FILTER_ALL)
|
||||
));
|
||||
baton->bufferOut = static_cast<char*>(area->data);
|
||||
baton->bufferOutLength = area->length;
|
||||
@ -758,7 +757,8 @@ class PipelineWorker : public AsyncWorker {
|
||||
->set("strip", !baton->withMetadata)
|
||||
->set("compression", baton->compressionLevel)
|
||||
->set("interlace", baton->progressive)
|
||||
->set("filter", baton->withoutAdaptiveFiltering ? VIPS_FOREIGN_PNG_FILTER_NONE : VIPS_FOREIGN_PNG_FILTER_ALL)
|
||||
->set("filter", baton->withoutAdaptiveFiltering ?
|
||||
VIPS_FOREIGN_PNG_FILTER_NONE : VIPS_FOREIGN_PNG_FILTER_ALL)
|
||||
);
|
||||
baton->formatOut = "png";
|
||||
} else if (baton->formatOut == "webp" || isWebp || (matchInput && inputImageType == ImageType::WEBP)) {
|
||||
|
@ -9,10 +9,10 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"async": "^1.5.2",
|
||||
"benchmark": "^2.0.0",
|
||||
"benchmark": "^2.1.0",
|
||||
"gm": "^1.21.0",
|
||||
"imagemagick": "^0.1.3",
|
||||
"imagemagick-native": "elad/node-imagemagick-native",
|
||||
"imagemagick-native": "^1.9.2",
|
||||
"jimp": "^0.2.20",
|
||||
"lwip": "^0.0.8",
|
||||
"semver": "^5.1.0"
|
||||
|
@ -306,26 +306,15 @@
|
||||
...
|
||||
fun:vips__magick_read_header
|
||||
}
|
||||
{
|
||||
cond_magick_is_palette_image_get_bands
|
||||
Memcheck:Cond
|
||||
fun:IsPaletteImage
|
||||
...
|
||||
fun:get_bands
|
||||
}
|
||||
{
|
||||
value_magick_is_palette_image
|
||||
Memcheck:Value8
|
||||
fun:IsPaletteImage
|
||||
...
|
||||
fun:get_bands
|
||||
}
|
||||
{
|
||||
cond_magick_is_palette_image_parse_header
|
||||
cond_magick_is_palette_image
|
||||
Memcheck:Cond
|
||||
fun:IsPaletteImage
|
||||
...
|
||||
fun:parse_header
|
||||
}
|
||||
|
||||
# glib g_file_read_link
|
||||
|
@ -19,18 +19,15 @@ describe('cpplint', function() {
|
||||
// Lint each source file
|
||||
cpplint({
|
||||
files: [file],
|
||||
linelength: 140,
|
||||
linelength: 120,
|
||||
filters: {
|
||||
legal: {
|
||||
copyright: false
|
||||
},
|
||||
build: {
|
||||
include: false,
|
||||
include_order: false
|
||||
include: false
|
||||
},
|
||||
whitespace: {
|
||||
blank_line: false,
|
||||
comments: false,
|
||||
parens: false
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user