[ansel] "import" and "add" with the "ansel/bin/ansel" script is throwing errors

Martin Vieregge-Heyng mvh at ferroxon.de
Fri Sep 13 08:54:08 UTC 2013


Zitat von Michael J Rubinsky <mrubinsk at horde.org>:

> Quoting Michael J Rubinsky <mrubinsk at horde.org>:
>
>> Quoting Martin Vieregge-Heyng <mvh at ferroxon.de>:
>>
>>> Hi Horde/Ansel-team!
>>>
>>> I need to make use of the remote API via the "ansel/bin/ansel"  
>>> H5-script. Therefore made some tests and found that the comands  
>>> "list" and "create" are working as expected. "import" and "add"  
>>> are throwing a "Fatal Error":
>>>
>>> ---snip---
>>> server:/usr/share/php5/PEAR/www/horde/ansel/bin # ./ansel -u xxxx  
>>> -p secret --file='/home/xxxx/oven.jpg' -g=5 add
>>> Logged in successfully as "xxxx".
>>>
>>> ====================
>>>
>>> Fatal Error:
>>> Can't get unknown file type "/home/mvh/oven.jpg".
>>> In /usr/share/php5/PEAR/www/horde/ansel/lib/Ansel.php on line 445
>>>
>>> 1. Ansel_Cli_Helper_Local->add()  
>>> /usr/share/php5/PEAR/www/horde/ansel/bin/ansel:191
>>> 2. Ansel::getImageFromFile()  
>>> /usr/share/php5/PEAR/www/horde/ansel/bin/ansel:715
>>>
>>> ====================
>>> ---snap---
>>>
>>> Is this a problem of my installation/config.php? Uploading via  
>>> Horde/Ansel webinterface is working as expected. Mime database  
>>> "Magic" is set correctly in the horde/config. Didn't test the  
>>> "reset" and "exif" comands up to now.
>>
>> This error is thrown when Horde_Mime_Magic::analyzeFile() returns a  
>> mime type that is not an image type. You can try running the  
>> following command in the phpshell in the Horde administrative menu:
>>
>> var_dump(Horde_Mime_Magic::analyzeFile('/path/to/file.jpg','/path/to/mime_magic_db'));
>
> Another possibility is that since you are using this to upload to a  
> remote system, the local machine that you are using to execute the  
> ansel cli script does not have the mimemagic database setup correctly.
> -- 
> mike
>
> The Horde Project (www.horde.org)
> mrubinsk at horde.org


Hi mike!

Solved! Thanks for your help. It was an entry in the hordes config. I  
added the path to the $conf[mime][magic_db]:"/to/some/magic". It  
spoiled the output. Everything worked fine when set to empty: "".

Regards, Martin

PS: No tests from a remote system up to now. Doesn'td that include a  
lot of  "Horde/Pear/Php/..." library stuff installed on host? A bit  
overdone, just for uploading some img.

-- 
Schlieper & Heyng GmbH & Co. KG
FERROXON-Pigmente
P.O. Box 27
Gewerbegebiet Talstraße 10
D-57647 Nistertal / Westerwald

fon: +49 2661 94004-0
fax: +49 2661 94004-80

GF: M. Vieregge-Heyng, Dr. Ralf Hög
HRA: 1369, HRB: 5849, AG Montabaur


More information about the ansel mailing list