Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
#include
//system commands #include
#include
//time #include
//Strings for file names #include
//sleep #include
//math using namespace std; using namespace cv; /** Function Headers */ int getframes(string inFile); /**@function main */ int main(int argc, char** argv) { string inFile = ""; if (argc == 1){ inFile = "aabb.gif"; cout << "number of Farmes: " << getframes(inFile)<< endl; } if( argc == 2 ) { inFile = argv[1]; cout << getframes(inFile) << endl; } if(argc >= 3){ cout << "Usage: ./program InputFile \n \n This program converts gifs to png, that can be converted to gps srf files. \n"; return 1; } return 0; } int getframes(string inFile){ system("rm /dev/shm/neu"); //stores system command output until I can put it in a varible. system(("identify -format \"%n\n\" " +inFile+ "| head -1 > /dev/shm/neu").c_str()); FILE* file = fopen ("/dev/shm/neu", "r"); int i = 0; fscanf (file, "%d", &i); while (!feof (file)){ fscanf (file, "%d", &i); } //cout << "Number of frames in the file are: " << i <
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)