Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding "How to" to execute "iamge_to_c" in terminal #4

Closed
yankobogdan opened this issue Jun 5, 2021 · 6 comments
Closed

Adding "How to" to execute "iamge_to_c" in terminal #4

yankobogdan opened this issue Jun 5, 2021 · 6 comments

Comments

@yankobogdan
Copy link

Hi. I found your library AnimatedGIF very useful for my project. And of course, I want to try with my own GIFs. I understand the purpose of this repository to convert GIFs to C array, but I am a little bit confused about how to use that.
I assume that I need to run image_to_c script in the terminal sending image that I want to convert the path as param, but I don't know how exactly to do it. I am using Mac OS.
I think it's would be very useful for others to have that short description on main page of the repository.
Thanks.

@bitbank2
Copy link
Owner

bitbank2 commented Jun 5, 2021

The image_to_c program (not a script) tells you how to use it if you run it with no parameters.

@AlonsoMinas
Copy link

Hi bitbank2

may I ask you please to help me a little. Below the result of using your tool for converting a gif to C array.
Unfortunately it is doing something but not creating a file with content. What is it what I am doing wrong?

When I enter following in the Mac terminal.


ast login: Sun Dec 12 14:48:36 on ttys001
You have new mail.
....@.....-iMac ~ % open /Users/...../Desktop/...../Programmierung/image_to_c-master/dist/MacOS/image_to_c ./flame.gif > outtest.h
....@....-iMac ~ %

ast login: Sun Dec 12 14:50:14 on ttys000
You have new mail.
/Users/..../Desktop/..../Programmierung/image_to_c-master/dist/MacOS/image_to_c ; exit;
....@......-iMac ~ % /Users/......./Desktop/..../Programmierung/image_to_c-master/dist/MacOS/image_to_c ; exit;
image_to_c Copyright (c) 2020 BitBank Software, Inc.
Written by Larry Bank

Usage: image_to_c
output is written to stdout
example:

image_to_c ./test.jpg > test.h

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Prozess beendet]


It is creating a file but without content.

image

@bitbank2
Copy link
Owner

Hi @AlonsoMinas,
I just tested the latest code on my Mac (which I use for 99.99% of my work) and it works fine. I'm really not sure why the stdout generated by my program wouldn't get captured properly by a ">" redirect. Does it print the output to the terminal if you don't specify an output file?

@AlonsoMinas
Copy link

Hi @AlonsoMinas,
I just tested the latest code on my Mac (which I use for 99.99% of my work) and it works fine. I'm really not sure why the stdout generated by my program wouldn't get captured properly by a ">" redirect. Does it print the output to the terminal if you don't specify an output file?

Hi Larry,

thank you for your answer and efforts with me. I have tried it like this:

...@...-iMac ~ % open /Users/.../Desktop/.../Programmierung/image_to_c-master/dist/MacOS/image_to_c ./flame.gif
...@...-iMac ~ %

Terminal is showing:

Last login: Sun Dec 12 18:44:00 on ttys001
You have new mail.
/Users/.../Desktop/.../Programmierung/image_to_c-master/dist/MacOS/image_to_c ; exit;
...@...-iMac ~ % /Users/.../Desktop/.../Programmierung/image_to_c-master/dist/MacOS/image_to_c ; exit;
image_to_c Copyright (c) 2020 BitBank Software, Inc.
Written by Larry Bank

Usage: image_to_c
output is written to stdout
example:

image_to_c ./test.jpg > test.h

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Prozess beendet]

When I search for test.h on my Mac there is no file found with this name. There must be something I am doing wrong?

But I have created attached two files with another tool in internet (https://lvgl.io/tools/imageconverter) may you check if this will work with your AnimatedGIF on a ESP32 ( I don't have it yet, is ordered otherwise I would try it my self).
If we cannot solve the problem and my files are not usable I will try it with a Windows computer.

Archiv.zip

@bitbank2
Copy link
Owner

Why are you using "open" to run the program? Just run it like any other command line program:

./image_to_c

@bitbank2 bitbank2 reopened this Dec 12, 2021
@AlonsoMinas
Copy link

Great worked thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants