ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i am looking for a tool to get the width and height of an image file that is formatted in any of the major image formats like: bmp, gif, jpg, png, and more, even if the extension of the file name is wrong (for example a png file named as a gif file). it will need to figure out the format based on file contents.
it's output needs to be basically simple enough for a small shell script to parse it. output that is just the 2 numbers would be good.
If you bothered to search, you should state what search terms you used, and what's wrong with the results you received.
This does several things:
1) it would demonstrate that you're not just being lazy.
2) it helps the next person using those same search terms to find an answer.
3) it allows responders to provide useful advice instead of repeating what you've already dismissed.
If you bothered to search, you should state what search terms you used, and what's wrong with the results you received.
This does several things:
1) it would demonstrate that you're not just being lazy.
2) it helps the next person using those same search terms to find an answer.
3) it allows responders to provide useful advice instead of repeating what you've already dismissed.
i did not bother to search because i am unaware of a search engine capable of understanding a search expression like "...that produces easy to parse output".
i did not bother to search because i am unaware of a search engine capable of understanding a search expression like "...that produces easy to parse output".
And there is no one who knows what you mean by that.
i did not bother to search because i am unaware of a search engine capable of understanding a search expression like "...that produces easy to parse output".
That's a lame excuse. Prefix your search with "bash script" and the results will be something that is easy to parse.
Better yet, search for what you're trying to do with that information, and there's a fair chance someone has already done it and may have released the results.
And there is no one who knows what you mean by that.
probably not. but maybe with an exchange of questions and answers, we can work that out. i wonder how well search engines will do that in 50 years. i wonder if the search engines, then, will know what i mean by that or will they also need to ask me.
it looks like exiftool (had to install it on my Xubuntu 20.4 x86) has the best output for many items of meta data.
Several scripting and other languages have APIs for working with EXIF data, for more flexibility. For example, there are Image::EXIFTool in Perl and the exif module for Python3.
Better yet, search for what you're trying to do with that information, and there's a fair chance someone has already done it and may have released the results.
it's a local task, so no one would has done it. the information is simple, but a search didn't do as well as this thread. michaelk's answer worked best.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.