LINUX.ORG.RU

Подскажите либу

 , ,


2

2

Всем привет, нужна либа для обрезки\ресайза изображения. Чтобы в экспорте было Си API, чтобы не сложно было компилять и чтобы кроссплатформенное типа для Win\Lin, можно только x64. Собственно, есть чё?

Пробовал: 1) OpenCV - боль собирать в винде, экспорт на 80% в формате С++. 2) libmagic - чёт вообще не собралось через mingw, ну и не очень понял как резать фоточки.

★★★★

Последнее исправление: AntonyRF (всего исправлений: 2)

Ответ на: комментарий от Deleted

Так выхлоп дай почитать.

Да например:

 MSYS /c/libvips
$ ./autogen.sh
testing for glibtoolize ... using libtoolize
configure.ac:254: installing './compile'
configure.ac:130: installing './config.guess'
configure.ac:130: installing './config.sub'
configure.ac:13: installing './install-sh'
configure.ac:13: installing './missing'
cplusplus/Makefile.am: installing './depcomp'
libvips/Makefile.am:77: error: HAVE_INTROSPECTION does not appear in AM_CONDITIONAL
configure: loading site script /etc/config.site
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
./configure: line 3615: syntax error near unexpected token `1.30.0'
./configure: line 3615: `GOBJECT_INTROSPECTION_CHECK(1.30.0)'

AntonyRF ★★★★
() автор топика
Ответ на: комментарий от AntonyRF

Да например:

Про комбинацию msys и gir не подскажу. Да и говорил я, что vips - это перебор. Я ожидал всё-таки выхлоп imageworsener или netpbm.

Deleted
()
Ответ на: комментарий от Deleted

Лады, давай его посмотрим:

imageworsener
$ autoconf
configure.ac:7: error: possibly undefined macro: AM_CONFIG_HEADER
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:15: error: possibly undefined macro: AM_PROG_CC_C_O
configure.ac:17: error: possibly undefined macro: AM_PROG_LIBTOOL
configure.ac:23: error: possibly undefined macro: AM_INIT_AUTOMAKE


$ automake
configure.ac: error: no proper invocation of AM_INIT_AUTOMAKE was found.
configure.ac: You should verify that configure.ac invokes AM_INIT_AUTOMAKE,
configure.ac: that aclocal.m4 is present in the top-level directory,
configure.ac: and that aclocal.m4 was recently regenerated (using aclocal)
Makefile.am: error: required file './INSTALL' not found
Makefile.am:   'automake --add-missing' can install 'INSTALL'
Makefile.am: error: required file './NEWS' not found
Makefile.am: error: required file './README' not found
Makefile.am: error: required file './AUTHORS' not found
Makefile.am: error: required file './ChangeLog' not found
Makefile.am: error: required file './COPYING' not found
Makefile.am:   'automake --add-missing' can install 'COPYING'
Makefile.am:1: error: Libtool library used but 'LIBTOOL' is undefined
Makefile.am:1:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
Makefile.am:1:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
Makefile.am:1:   If 'LT_INIT' is in 'configure.ac', make sure
Makefile.am:1:   its definition is in aclocal's search path.
Makefile.am:2: warning: source file 'src/imagew-main.c' is in a subdirectory,
Makefile.am:2: but option 'subdir-objects' is disabled
automake-1.16: warning: possible forward-incompatibility.
automake-1.16: At least a source file is in a subdirectory, but the 'subdir-objects'
automake-1.16: automake option hasn't been enabled.  For now, the corresponding output
automake-1.16: object file(s) will be placed in the top-level directory.  However,
automake-1.16: this behaviour will change in future Automake versions: they will
automake-1.16: unconditionally cause object files to be placed in the same subdirectory
automake-1.16: of the corresponding sources.
automake-1.16: You are advised to start using 'subdir-objects' option throughout your
automake-1.16: project, to avoid future incompatibilities.
Makefile.am:2: warning: source file 'src/imagew-api.c' is in a subdirectory,
Makefile.am:2: but option 'subdir-objects' is disabled
Makefile.am:2: warning: source file 'src/imagew-resize.c' is in a subdirectory,
Makefile.am:2: but option 'subdir-objects' is disabled
Makefile.am:2: warning: source file 'src/imagew-opt.c' is in a subdirectory,
Makefile.am:2: but option 'subdir-objects' is disabled
Makefile.am:2: warning: source file 'src/imagew-allfmts.c' is in a subdirectory,
Makefile.am:2: but option 'subdir-objects' is disabled
Makefile.am:2: warning: source file 'src/imagew-bmp.c' is in a subdirectory,
Makefile.am:2: but option 'subdir-objects' is disabled
Makefile.am:2: warning: source file 'src/imagew-gif.c' is in a subdirectory,
Makefile.am:2: but option 'subdir-objects' is disabled
Makefile.am:2: warning: source file 'src/imagew-miff.c' is in a subdirectory,
Makefile.am:2: but option 'subdir-objects' is disabled
Makefile.am:2: warning: source file 'src/imagew-tiff.c' is in a subdirectory,
Makefile.am:2: but option 'subdir-objects' is disabled
Makefile.am:2: warning: source file 'src/imagew-zlib.c' is in a subdirectory,
Makefile.am:2: but option 'subdir-objects' is disabled
Makefile.am:2: warning: source file 'src/imagew-png.c' is in a subdirectory,
Makefile.am:2: but option 'subdir-objects' is disabled
Makefile.am:2: warning: source file 'src/imagew-jpeg.c' is in a subdirectory,
Makefile.am:2: but option 'subdir-objects' is disabled
Makefile.am:2: warning: source file 'src/imagew-webp.c' is in a subdirectory,
Makefile.am:2: but option 'subdir-objects' is disabled
Makefile.am:2: warning: source file 'src/imagew-pnm.c' is in a subdirectory,
Makefile.am:2: but option 'subdir-objects' is disabled
Makefile.am:2: warning: source file 'src/imagew-util.c' is in a subdirectory,
Makefile.am:2: but option 'subdir-objects' is disabled
Makefile.am:20: warning: source file 'src/imagew-cmd.c' is in a subdirectory,
Makefile.am:20: but option 'subdir-objects' is disabled
Makefile.am: error: required file './depcomp' not found
Makefile.am:   'automake --add-missing' can install 'depcomp'
/usr/share/automake-1.16/am/depend2.am: error: am__fastdepCC does not appear in AM_CONDITIONAL
/usr/share/automake-1.16/am/depend2.am:   The usual way to define 'am__fastdepCC' is to add 'AC_PROG_CC'
/usr/share/automake-1.16/am/depend2.am:   to 'configure.ac' and run 'aclocal' and 'autoconf' again
/usr/share/automake-1.16/am/depend2.am: error: AMDEP does not appear in AM_CONDITIONAL
/usr/share/automake-1.16/am/depend2.am:   The usual way to define 'AMDEP' is to add one of the compiler tests
/usr/share/automake-1.16/am/depend2.am:     AC_PROG_CC, AC_PROG_CXX, AC_PROG_OBJC, AC_PROG_OBJCXX,
/usr/share/automake-1.16/am/depend2.am:     AM_PROG_AS, AM_PROG_GCJ, AM_PROG_UPC
/usr/share/automake-1.16/am/depend2.am:   to 'configure.ac' and run 'aclocal' and 'autoconf' again

AntonyRF ★★★★
() автор топика
Последнее исправление: AntonyRF (всего исправлений: 1)
  1. libmagic - чёт вообще не собралось через mingw, ну и не очень понял как резать фоточки.

В чём проблема? Можно вообще поставить MSYS2, накатить там пакет imagemagick, взять оттуда либу и хедеры.

https://imagemagick.org/MagickWand/resize.htm

ИМХО, если тебе нужно не слишком легковесное решение, которое жуёт все форматы, то стоит обратить свой взор именно на эту либу.

EXL ★★★★★
()
Ответ на: комментарий от AntonyRF

Лады, давай его посмотрим:

Хмм. Да. Документация забабахана по шаблону. А про изменения забыли написать. Но без autoconf точно ничего не получится. Я лично делаю так:

autoreconf -fiv
./configure --prefix=/usr
make
Deleted
()
Ответ на: комментарий от EXL

Можно вообще поставить MSYS2, накатить там пакет imagemagick, взять оттуда либу и хедеры.

Ща, попробую

AntonyRF ★★★★
() автор топика
Ответ на: комментарий от Thetan

stb предлагали? Или не подходит?

На выбор тогда stb vs imscript

Deleted
()
Ответ на: комментарий от AntonyRF

Это что ли для статической линковки такое расширение?

Ну да. Можешь смело пихать в любой проект и получишь прогу без dll.

Deleted
()
Ответ на: комментарий от Deleted

Так мне в Rust пихнуть надо, там с этим не всё так просто. Один из вопросов на собеседование - мол расскажите про ffi и как подключить С библиотеку к проекту Rust.

AntonyRF ★★★★
() автор топика
Ответ на: комментарий от AntonyRF

Так мне в Rust пихнуть надо, там с этим не всё так просто

Опа. Вот это финт ушами. Я пас.

PS: Добавь тег rust. Мож кто найдётся подсказать.

Deleted
()
Ответ на: комментарий от Deleted

Я пас.

Та лан, там просто нужно получить динамически подключаемую библиотеку, а дальше я сам разберусь =)

AntonyRF ★★★★
() автор топика
Ответ на: комментарий от AntonyRF

там просто нужно получить динамически подключаемую библиотеку

Так поковыряй опции ./configure. Типа --enable-shared.

Deleted
()
Последнее исправление: Deleted (всего исправлений: 1)
Ответ на: комментарий от AntonyRF

Лады

А по поводу rust, это тебе на kornelski надо глянуть. Он по rust не по-детски прикалывается.

Deleted
()

Для ресайза - libswscale из состава ffmpeg, для обрезки - наверняка какой-то фильтр на эту тему в ffmpeg тоже есть

Harald ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.