mirror of
https://github.com/simon987/sist2.git
synced 2025-04-17 01:06:43 +00:00
Update dependencies
This commit is contained in:
parent
eab6101cf7
commit
9ace5774af
@ -123,7 +123,7 @@ binaries.
|
|||||||
libssl-dev uuid-dev python3 libmagic-dev libfreetype6-dev \
|
libssl-dev uuid-dev python3 libmagic-dev libfreetype6-dev \
|
||||||
libcurl4-openssl-dev libbz2-dev yasm libharfbuzz-dev ragel \
|
libcurl4-openssl-dev libbz2-dev yasm libharfbuzz-dev ragel \
|
||||||
libarchive-dev libtiff5 libpng16-16 libpango1.0-dev \
|
libarchive-dev libtiff5 libpng16-16 libpango1.0-dev \
|
||||||
libxml2-dev
|
libxml2-dev libopenjp2-7-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Build
|
2. Build
|
||||||
|
2
argparse
2
argparse
@ -1 +1 @@
|
|||||||
Subproject commit fafc503d23d077bda40c29e8a20ea74707452721
|
Subproject commit 4ed6099cb33245b06343518b9f3c45ac56e8283c
|
2
cJSON
2
cJSON
@ -1 +1 @@
|
|||||||
Subproject commit 2d4ad841927590198ecfb8b27335a0cd97cf15c1
|
Subproject commit e8077d01500279a7b45b8cd7a0ae94ea7ad5748a
|
@ -1 +1 @@
|
|||||||
Subproject commit 8887991a3109f94b7d019a11a86e6cd900105258
|
Subproject commit e27a35e0458224ef6f47753f248ba84ec8284818
|
@ -1 +1 @@
|
|||||||
Subproject commit b28c282585afd3bff844e84eae7f29e1a1267aef
|
Subproject commit b7617f6b3cfa0abf10292ea79bcd53ef61a08e90
|
@ -1 +1 @@
|
|||||||
Subproject commit cc03be70fded1ad6a8cedad656456386a1bd08e8
|
Subproject commit 320b4bbb025db7f8c68d3c2b0b9d9fad459c7af3
|
@ -1 +1 @@
|
|||||||
Subproject commit 3db0ff91bc6db20fc4cb035be366a9bbb4e701cf
|
Subproject commit a6d3c1d64b655f5f151a01fda2b7b0bf50cc61aa
|
@ -1 +1 @@
|
|||||||
Subproject commit c50ac19e412fe7830dfef5d1cbc71e9da3405c96
|
Subproject commit 1e1ac03fe4c8bfd9022d945b05e0cc1343827399
|
@ -1 +1 @@
|
|||||||
Subproject commit 73329b61eb82d65b827e92ab46b2db7da85163c7
|
Subproject commit 2b3b230b79ecae119b7eb847f2f9545a46bef13c
|
@ -1 +1 @@
|
|||||||
Subproject commit ac3737372a00b8778b528094dd5bd58a74f67d42
|
Subproject commit 563ecfb55ca77c0fc5ea19e4885e00f55ec82ca9
|
@ -1 +1 @@
|
|||||||
Subproject commit f268e6615e619a7140de78d9db3f8240fa8c68bd
|
Subproject commit 90405ad0e3bdb7b779d8edaf147bff496873f84b
|
@ -238,7 +238,7 @@ int index_args_validate(index_args_t *args, int argc, const char **argv) {
|
|||||||
|
|
||||||
args->script = malloc(info.st_size + 1);
|
args->script = malloc(info.st_size + 1);
|
||||||
res = read(fd, args->script, info.st_size);
|
res = read(fd, args->script, info.st_size);
|
||||||
if (res == -1) {
|
if (res < 0) {
|
||||||
fprintf(stderr, "Error reading script file '%s': %s\n", args->script_path, strerror(errno));
|
fprintf(stderr, "Error reading script file '%s': %s\n", args->script_path, strerror(errno));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,8 @@ void write_index_descriptor(char *path, index_descriptor_t *desc) {
|
|||||||
cJSON_AddNumberToObject(json, "timestamp", (double) desc->timestamp);
|
cJSON_AddNumberToObject(json, "timestamp", (double) desc->timestamp);
|
||||||
|
|
||||||
int fd = open(path, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR);
|
int fd = open(path, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR);
|
||||||
if (fd == -1) {
|
if (fd < 0) {
|
||||||
perror(path);
|
LOG_FATALF("serialize.c", "Could not write index descriptor: %s", strerror(errno));
|
||||||
}
|
}
|
||||||
char *str = cJSON_Print(json);
|
char *str = cJSON_Print(json);
|
||||||
write(fd, str, strlen(str));
|
write(fd, str, strlen(str));
|
||||||
@ -185,7 +185,7 @@ void write_document(document_t *doc) {
|
|||||||
|
|
||||||
int res = write(index_fd, buf.buf, buf.cur);
|
int res = write(index_fd, buf.buf, buf.cur);
|
||||||
if (res == -1) {
|
if (res == -1) {
|
||||||
perror("write");
|
LOG_FATALF("serialize.c", "Could not write document: %s", strerror(errno))
|
||||||
}
|
}
|
||||||
ScanCtx.stat_index_size += buf.cur;
|
ScanCtx.stat_index_size += buf.cur;
|
||||||
dyn_buffer_destroy(&buf);
|
dyn_buffer_destroy(&buf);
|
||||||
@ -334,7 +334,7 @@ void read_index_json(const char *path, UNUSED(const char *index_id), index_func
|
|||||||
char *line = NULL;
|
char *line = NULL;
|
||||||
size_t len;
|
size_t len;
|
||||||
size_t read = getline(&line, &len, file);
|
size_t read = getline(&line, &len, file);
|
||||||
if (read == -1) {
|
if (read < 0) {
|
||||||
if (line) {
|
if (line) {
|
||||||
free(line);
|
free(line);
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,13 @@
|
|||||||
__thread text_buffer_t thread_buffer;
|
__thread text_buffer_t thread_buffer;
|
||||||
|
|
||||||
|
|
||||||
fz_page *render_cover(fz_context *ctx, document_t *doc, fz_document *fzdoc) {
|
int render_cover(fz_context *ctx, document_t *doc, fz_document *fzdoc) {
|
||||||
|
|
||||||
int err = 0;
|
int err = 0;
|
||||||
fz_page *cover = NULL;
|
fz_page *cover = NULL;
|
||||||
|
|
||||||
fz_var(cover);
|
fz_var(cover);
|
||||||
|
fz_var(err);
|
||||||
fz_try(ctx)
|
fz_try(ctx)
|
||||||
cover = fz_load_page(ctx, fzdoc, 0);
|
cover = fz_load_page(ctx, fzdoc, 0);
|
||||||
fz_catch(ctx)
|
fz_catch(ctx)
|
||||||
@ -20,7 +21,7 @@ fz_page *render_cover(fz_context *ctx, document_t *doc, fz_document *fzdoc) {
|
|||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
fz_drop_page(ctx, cover);
|
fz_drop_page(ctx, cover);
|
||||||
LOG_WARNINGF(doc->filepath, "fz_load_page() returned error code [%d] %s", err, ctx->error.message)
|
LOG_WARNINGF(doc->filepath, "fz_load_page() returned error code [%d] %s", err, ctx->error.message)
|
||||||
return NULL;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
fz_rect bounds = fz_bound_page(ctx, cover);
|
fz_rect bounds = fz_bound_page(ctx, cover);
|
||||||
@ -45,14 +46,14 @@ fz_page *render_cover(fz_context *ctx, document_t *doc, fz_document *fzdoc) {
|
|||||||
fz_var(err);
|
fz_var(err);
|
||||||
fz_try(ctx)
|
fz_try(ctx)
|
||||||
{
|
{
|
||||||
pthread_mutex_lock(&ScanCtx.mupdf_mu);
|
// pthread_mutex_lock(&ScanCtx.mupdf_mu);
|
||||||
fz_run_page(ctx, cover, dev, fz_identity, NULL);
|
fz_run_page(ctx, cover, dev, fz_identity, NULL);
|
||||||
}
|
}
|
||||||
fz_always(ctx)
|
fz_always(ctx)
|
||||||
{
|
{
|
||||||
fz_close_device(ctx, dev);
|
fz_close_device(ctx, dev);
|
||||||
fz_drop_device(ctx, dev);
|
fz_drop_device(ctx, dev);
|
||||||
pthread_mutex_unlock(&ScanCtx.mupdf_mu);
|
// pthread_mutex_unlock(&ScanCtx.mupdf_mu);
|
||||||
}
|
}
|
||||||
fz_catch(ctx)
|
fz_catch(ctx)
|
||||||
err = ctx->error.errcode;
|
err = ctx->error.errcode;
|
||||||
@ -61,7 +62,7 @@ fz_page *render_cover(fz_context *ctx, document_t *doc, fz_document *fzdoc) {
|
|||||||
LOG_WARNINGF(doc->filepath, "fz_run_page() returned error code [%d] %s", err, ctx->error.message)
|
LOG_WARNINGF(doc->filepath, "fz_run_page() returned error code [%d] %s", err, ctx->error.message)
|
||||||
fz_drop_page(ctx, cover);
|
fz_drop_page(ctx, cover);
|
||||||
fz_drop_pixmap(ctx, pixmap);
|
fz_drop_pixmap(ctx, pixmap);
|
||||||
return NULL;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
fz_buffer *fzbuf = NULL;
|
fz_buffer *fzbuf = NULL;
|
||||||
@ -86,10 +87,11 @@ fz_page *render_cover(fz_context *ctx, document_t *doc, fz_document *fzdoc) {
|
|||||||
LOG_WARNINGF(doc->filepath, "fz_new_buffer_from_pixmap_as_png() returned error code [%d] %s", err,
|
LOG_WARNINGF(doc->filepath, "fz_new_buffer_from_pixmap_as_png() returned error code [%d] %s", err,
|
||||||
ctx->error.message)
|
ctx->error.message)
|
||||||
fz_drop_page(ctx, cover);
|
fz_drop_page(ctx, cover);
|
||||||
return NULL;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return cover;
|
fz_drop_page(ctx, cover);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void fz_err_callback(void *user, UNUSED(const char *message)) {
|
void fz_err_callback(void *user, UNUSED(const char *message)) {
|
||||||
@ -232,18 +234,11 @@ void parse_pdf(void *buf, size_t buf_len, document_t *doc) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fz_page *cover = NULL;
|
|
||||||
if (ScanCtx.tn_size > 0) {
|
if (ScanCtx.tn_size > 0) {
|
||||||
cover = render_cover(ctx, doc, fzdoc);
|
err = render_cover(ctx, doc, fzdoc);
|
||||||
} else {
|
|
||||||
fz_var(cover);
|
|
||||||
fz_try(ctx)
|
|
||||||
cover = fz_load_page(ctx, fzdoc, 0);
|
|
||||||
fz_catch(ctx)
|
|
||||||
cover = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cover == NULL) {
|
if (err == TRUE) {
|
||||||
fz_drop_stream(ctx, stream);
|
fz_drop_stream(ctx, stream);
|
||||||
fz_drop_document(ctx, fzdoc);
|
fz_drop_document(ctx, fzdoc);
|
||||||
fz_drop_context(ctx);
|
fz_drop_context(ctx);
|
||||||
@ -256,23 +251,19 @@ void parse_pdf(void *buf, size_t buf_len, document_t *doc) {
|
|||||||
|
|
||||||
for (int current_page = 0; current_page < page_count; current_page++) {
|
for (int current_page = 0; current_page < page_count; current_page++) {
|
||||||
fz_page *page = NULL;
|
fz_page *page = NULL;
|
||||||
if (current_page == 0) {
|
fz_var(err);
|
||||||
page = cover;
|
fz_try(ctx)
|
||||||
} else {
|
page = fz_load_page(ctx, fzdoc, current_page);
|
||||||
fz_var(err);
|
fz_catch(ctx)
|
||||||
fz_try(ctx)
|
err = ctx->error.errcode;
|
||||||
page = fz_load_page(ctx, fzdoc, current_page);
|
if (err != 0) {
|
||||||
fz_catch(ctx)
|
LOG_WARNINGF(doc->filepath, "fz_load_page() returned error code [%d] %s", err, ctx->error.message)
|
||||||
err = ctx->error.errcode;
|
text_buffer_destroy(&thread_buffer);
|
||||||
if (err != 0) {
|
fz_drop_page(ctx, page);
|
||||||
LOG_WARNINGF(doc->filepath, "fz_load_page() returned error code [%d] %s", err, ctx->error.message)
|
fz_drop_stream(ctx, stream);
|
||||||
text_buffer_destroy(&thread_buffer);
|
fz_drop_document(ctx, fzdoc);
|
||||||
fz_drop_page(ctx, page);
|
fz_drop_context(ctx);
|
||||||
fz_drop_stream(ctx, stream);
|
return;
|
||||||
fz_drop_document(ctx, fzdoc);
|
|
||||||
fz_drop_context(ctx);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fz_stext_page *stext = fz_new_stext_page(ctx, fz_bound_page(ctx, page));
|
fz_stext_page *stext = fz_new_stext_page(ctx, fz_bound_page(ctx, page));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user