mirror of
https://github.com/simon987/sist2.git
synced 2025-04-21 19:26:45 +00:00
Compare commits
No commits in common. "d44679131b2af29783d6f6d2f6a686dccffe2f5e" and "7873ef003d7b09e8a3eb4bb4c7ef4473deac30a2" have entirely different histories.
d44679131b
...
7873ef003d
@ -57,7 +57,7 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- /data/sist2-admin-data/:/sist2-admin/
|
- /data/sist2-admin-data/:/sist2-admin/
|
||||||
- /<path to index>/:/host
|
- /:/host
|
||||||
ports:
|
ports:
|
||||||
- 4090:4090
|
- 4090:4090
|
||||||
# NOTE: Don't expose this port publicly!
|
# NOTE: Don't expose this port publicly!
|
||||||
|
@ -18,7 +18,7 @@ services:
|
|||||||
container_name: sist2-admin
|
container_name: sist2-admin
|
||||||
volumes:
|
volumes:
|
||||||
- /data/sist2-admin-data/:/sist2-admin/
|
- /data/sist2-admin-data/:/sist2-admin/
|
||||||
- /<path to index>/:/host
|
- /:/host
|
||||||
ports:
|
ports:
|
||||||
- 4090:4090
|
- 4090:4090
|
||||||
# NOTE: Don't export this port publicly!
|
# NOTE: Don't export this port publicly!
|
||||||
|
@ -1,16 +1,5 @@
|
|||||||
|
|
||||||
MAGIC_PATHS = [
|
with open("/usr/lib/file/magic.mgc", "rb") as f:
|
||||||
"/vcpkg/installed/x64-linux/share/libmagic/misc/magic.mgc",
|
|
||||||
"/work/vcpkg/installed/x64-linux/share/libmagic/misc/magic.mgc",
|
|
||||||
"/usr/lib/file/magic.mgc"
|
|
||||||
]
|
|
||||||
|
|
||||||
for path in MAGIC_PATHS:
|
|
||||||
try:
|
|
||||||
with open(path, "rb") as f:
|
|
||||||
data = f.read()
|
data = f.read()
|
||||||
break
|
|
||||||
except:
|
|
||||||
continue
|
|
||||||
|
|
||||||
print("char magic_database_buffer[%d] = {%s};" % (len(data), ",".join(str(int(b)) for b in data)))
|
print("char magic_database_buffer[%d] = {%s};" % (len(data), ",".join(str(int(b)) for b in data)))
|
||||||
|
@ -25,7 +25,6 @@ const char *TESS_DATAPATHS[] = {
|
|||||||
"/usr/share/tessdata/",
|
"/usr/share/tessdata/",
|
||||||
"/usr/share/tesseract-ocr/tessdata/",
|
"/usr/share/tesseract-ocr/tessdata/",
|
||||||
"/usr/share/tesseract-ocr/4.00/tessdata/",
|
"/usr/share/tesseract-ocr/4.00/tessdata/",
|
||||||
"/usr/share/tesseract-ocr/5/tessdata/",
|
|
||||||
"./",
|
"./",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
static const char *const Version = VERSION;
|
static const char *const Version = VERSION;
|
||||||
static const int VersionMajor = 3;
|
static const int VersionMajor = 3;
|
||||||
static const int VersionMinor = 4;
|
static const int VersionMinor = 4;
|
||||||
static const int VersionPatch = 3;
|
static const int VersionPatch = 2;
|
||||||
|
|
||||||
#ifndef SIST_PLATFORM
|
#ifndef SIST_PLATFORM
|
||||||
#define SIST_PLATFORM unknown
|
#define SIST_PLATFORM unknown
|
||||||
|
14
third-party/libscan/libscan/ebook/ebook.c
vendored
14
third-party/libscan/libscan/ebook/ebook.c
vendored
@ -175,19 +175,9 @@ int render_cover(scan_ebook_ctx_t *ctx, fz_context *fzctx, document_t *doc, fz_d
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define IS_IGNORED_MESSAGE(message) \
|
|
||||||
( \
|
|
||||||
strstr(message, "invalid glyph index") \
|
|
||||||
|| strstr(message, "... repeated") \
|
|
||||||
) \
|
|
||||||
|
|
||||||
void fz_err_callback(void *user, const char *message) {
|
void fz_err_callback(void *user, const char *message) {
|
||||||
document_t *doc = (document_t *) user;
|
document_t *doc = (document_t *) user;
|
||||||
|
|
||||||
if (IS_IGNORED_MESSAGE(message)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const scan_ebook_ctx_t *ctx = &thread_ctx;
|
const scan_ebook_ctx_t *ctx = &thread_ctx;
|
||||||
CTX_LOG_WARNINGF(doc->filepath, "FZ: %s", message);
|
CTX_LOG_WARNINGF(doc->filepath, "FZ: %s", message);
|
||||||
}
|
}
|
||||||
@ -195,10 +185,6 @@ void fz_err_callback(void *user, const char *message) {
|
|||||||
void fz_warn_callback(void *user, const char *message) {
|
void fz_warn_callback(void *user, const char *message) {
|
||||||
document_t *doc = (document_t *) user;
|
document_t *doc = (document_t *) user;
|
||||||
|
|
||||||
if (IS_IGNORED_MESSAGE(message)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const scan_ebook_ctx_t *ctx = &thread_ctx;
|
const scan_ebook_ctx_t *ctx = &thread_ctx;
|
||||||
CTX_LOG_DEBUGF(doc->filepath, "FZ: %s", message);
|
CTX_LOG_DEBUGF(doc->filepath, "FZ: %s", message);
|
||||||
}
|
}
|
||||||
|
12
third-party/libscan/libscan/media/media.c
vendored
12
third-party/libscan/libscan/media/media.c
vendored
@ -223,11 +223,15 @@ read_frame(scan_media_ctx_t *ctx, AVFormatContext *pFormatCtx, AVCodecContext *d
|
|||||||
|
|
||||||
void append_tag_meta_if_not_exists(scan_media_ctx_t *ctx, document_t *doc, AVDictionaryEntry *tag, enum metakey key) {
|
void append_tag_meta_if_not_exists(scan_media_ctx_t *ctx, document_t *doc, AVDictionaryEntry *tag, enum metakey key) {
|
||||||
|
|
||||||
if (meta_contains_key(doc->meta_head, key)) {
|
meta_line_t *meta = doc->meta_head;
|
||||||
CTX_LOG_DEBUGF(doc->filepath, "Ignoring duplicate tag: '%02x=%s'",
|
while (meta != NULL) {
|
||||||
key, tag->value);
|
if (meta->key == key) {
|
||||||
|
CTX_LOG_DEBUGF(doc->filepath, "Ignoring duplicate tag: '%02x=%s' and '%02x=%s'",
|
||||||
|
key, meta->str_val, key, tag->value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
meta = meta->next;
|
||||||
|
}
|
||||||
|
|
||||||
text_buffer_t tex = text_buffer_create(-1);
|
text_buffer_t tex = text_buffer_create(-1);
|
||||||
text_buffer_append_string0(&tex, tag->value);
|
text_buffer_append_string0(&tex, tag->value);
|
||||||
@ -441,7 +445,7 @@ int decode_frame_and_save_thumbnail(scan_media_ctx_t *ctx, AVFormatContext *pFor
|
|||||||
return SAVE_THUMBNAIL_FAILED;
|
return SAVE_THUMBNAIL_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->tesseract_lang != NULL && thumbnail_index == 0 && !meta_contains_key(doc->meta_head, MetaContent)) {
|
if (ctx->tesseract_lang != NULL && thumbnail_index == 0) {
|
||||||
ocr_image(ctx, doc, decoder, frame_and_packet->frame);
|
ocr_image(ctx, doc, decoder, frame_and_packet->frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
third-party/libscan/libscan/util.h
vendored
14
third-party/libscan/libscan/util.h
vendored
@ -392,18 +392,4 @@ static parse_job_t *create_parse_job(const char *filepath, int mtime, size_t st_
|
|||||||
return job;
|
return job;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int meta_contains_key (meta_line_t *meta_head, enum metakey key) {
|
|
||||||
|
|
||||||
meta_line_t *meta = meta_head;
|
|
||||||
while (meta != NULL) {
|
|
||||||
if (meta->key == key) {
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
meta = meta->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user