hoseinisalim

hoseinisalim

Create image thumbnail in windows environment

i am using ffmpeg library for thumbnail image. My project runs in windows environment.
When executing the following code:

Thumbnex.create_thumbnail(url, new_url ,max_width: 64,max_height: 64)

I receive the following error in my code:

System.cmd("ffprobe", ["-show_format", "c:/Users/Salim/Desktop/Data/Elixir/Upload/d2e04a59-5fef-4f22-82d5-e0c6a1f25ea6.jpeg"], [stderr_to_stdout: true])
** (ErlangError) Erlang error: :enoent

ImageMagic and FFprobe installed on my system.

Most Liked

hauleth

hauleth

Are these in your %PATH%? Because that is how System.cmd/2 is looking for executables. Just installing them doesn’t necessarily add it to %PATH%.

dimitarvp

dimitarvp

First try this:

System.cmd("ffprobe", ["--version"])

To make sure that it can indeed be invoked. If so then the :enoent error means that the file parameter you supplied in your OP does not exist.

NobbZ

NobbZ

No, :enoent is only returned when the cmd wasn’t found.

If the cmd was found, and it was unable to find the file specified in its argument list, it has to communicate this fact through its exitcode, stout and stderr. You have access to the first 2 via the returned tuple then:

System.cmd("cat", ["this-file-does-not-exist"])
#=> {"", 1}

Of course, this is specific to cat, ffprobe might have a different exit code or output in this case.

Where Next?

Popular in Questions Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
Kurisu
For example for a current url like http://localhost:4000/cosmetic/products?_utf8=✓&query=perfume&page=2, I would like to get: ...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 126479 1222
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

We're in Beta

About us Mission Statement