Questions tagged [libmagic]

The libmagic library identifies different file types.

The libmagic library is able to identify different types of files by analyzing their contents. It is similar in spirit to the code used in the Unix file command.

50 questions
0
votes
0 answers

How do I solve "libmagic" import error in Azure Container App

$ python3 manage.py migrate Traceback (most recent call last): `File "/app/manage.py", line 24, in main() File "/app/manage.py", line 20, in main execute_from_command_line(sys.argv) File…
0
votes
1 answer

Linking magic (c library) to cargo project using crates cargo-vcpkg and magic on Windows

My cargo project depends on libmagic on vcpkg. I am using a crate called 'cargo-vcpkg' to manage my C deps and the crate magic provides bindings for that library. I am on the latest version of Windows 11 64 Bit My dependencies in Cargo.toml look as…
0
votes
0 answers

Exception Value:failed to find libmagic. Check your installation in windows 11?

(https://i.stack.imgur.com/vlQMv.png) Error during the libmagic installation When i am doing lanchain + gpt + python project using jupyter notebook its always shows this error. I installed libmagic and I also installed python magic. I have done pipi…
0
votes
1 answer

use two libraries with same modules in python

Two libraries are found on Pypi, 'python-magic' and 'filemagic', which can be imported with same import statement: https://pypi.org/project/python-magic/ https://pypi.org/project/filemagic/ import magic I want to import both of these libraries in my…
0
votes
2 answers

46: regex error 17 for `(dryad-bibo/v)[0-9].[0-9]', (match failed)

I'm trying to determine the mime-type for several types of files using libmagic and the following bit of code: auto handle = ::magic_open(MAGIC_MIME_TYPE); ::magic_load(handle, NULL); // Both of these fail with the same error // file_path being a…
Thizzer
  • 16,153
  • 28
  • 98
  • 139
0
votes
1 answer

Provide a magic database to libmagic

I've a simple C code that returns the filetype of the given file. I can give it any filename from the command line, and it will return the filetype: #include #include int main(int argc, char **argv) { unsigned modes = ( …
15 Volts
  • 1,946
  • 15
  • 37
0
votes
1 answer

Getting Requires: libMagickWand.so.5()(64bit) exception

am trying to install Install PHP 7.1 on CentOS using docker file, but looks like some error is always stopping, Dockerfile: FROM centos:7 # Install some must-haves RUN yum -y install vim wget sendmail RUN yum -y install libtool make automake…
Satscreate
  • 495
  • 12
  • 38
0
votes
1 answer

Why can't I use `libmime` in my code? (OSError: mime.so: undefined symbol: magic_load)

I try to use libmagic in my c code. I compile the following code like this (gcc mime.c -shared -o mime.so). Unfortunately it throws me this error when using it: OSError: mime.so: undefined symbol: magic_load mime.c #include #include…
user13153466
0
votes
0 answers

Issue compiling libmagic program, magic_open, MAGIC_MIME and MAGIC_CHECK undeclared

I've been trying to use magic.h and magiclib in my program to help with file type identification. However when I try compiling the program it states magic_open, MAGIC_MIME and MAGIC_CHECK are undeclared causing an error. I've tried the following…
Kevag6
  • 135
  • 1
  • 1
  • 10
0
votes
1 answer

How to render rails's template as PDF and ensure that it is PDF with FileMagic?

The Issue: App has a network of various printers. Some of them work through PrintNode. They should receive string encoded as base64. Code which receives my document looks like PrintNode::PrintJob.new printer_id, 'PrinterClass', method,…
0
votes
2 answers

How do i get Mac 10.13 to install modules into a 3.x install instead of 2.7

I'm trying to learn python practically. I installed PIP via easy_install and then I wanted to play with some mp3 files so I installed eyed3 via pip while in the project directory. Issue is that it installed the module into python 2.7 which comes…
Murray Chapman
  • 135
  • 1
  • 6
0
votes
0 answers

Calling Libmagic dll function return 126 error

I'm working on a project that need to use lib magic library to detect file mime type, I'm using 64 Bit version for windows (see: https://github.com/nscaife/file-windows) my project itself is C dll which I will call it from python. Loading the…
Ahmad Issa
  • 313
  • 1
  • 2
  • 15
0
votes
0 answers

file signature with C

I am working in a project to process images, and I need to check the contents of the images, to make sure that the format is valid (eg: png, jpg, etc). So, I know that I can use the magic numbers or file signature. I have tried to use the…
0
votes
1 answer

GCC 4.8 fails while linking with libmagic

I am struggling with the issue while linking my code against libmagic: test.c:(.text+0x16): undefined reference to `magic_open' test.c:(.text+0x50): undefined reference to `magic_load' test.c:(.text+0x60): undefined reference to…
thatsme
  • 325
  • 1
  • 2
  • 10
0
votes
0 answers

terminate called after throwing an instance of 'std::logic_error'

I am using C++ for a program retrieving informations about files. Among them, I want to find out the MIME type of a given file. To do so I use libmagic as follow: #include #include #include void foo (std::string…
user
  • 100
  • 11