[ansel] "import" and "add" with the "ansel/bin/ansel" script is throwing errors
Michael J Rubinsky
mrubinsk at horde.org
Wed Sep 11 16:19:04 UTC 2013
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'));
and see what the resulting mime type is. Looking at the code we seem
to use a different method for determining a valid image file during
the web upload. I don't remember if there was a specific reason for
this or not. I'll look into it more when I'm back in front of my
development box.
--
mike
The Horde Project (www.horde.org)
mrubinsk at horde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5849 bytes
Desc: S/MIME Signature
URL: <http://lists.horde.org/archives/ansel/attachments/20130911/99385bf8/attachment.bin>
More information about the ansel
mailing list