mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-22 22:45:39 +00:00
Convert QuickTime movies to image sequences
This commit is contained in:
@@ -5,23 +5,22 @@
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
if (argc < 8)
|
||||
if (argc < 7)
|
||||
{
|
||||
fprintf(stderr, "FTagData <input> <timestamp> <output> <file type ID> <file creator ID> <x pos> <y pos> [flags]");
|
||||
fprintf(stderr, "FTagData <timestamp> <output.gpf> <file type ID> <file creator ID> <x pos> <y pos> [flags]");
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::string inPath = argv[1];
|
||||
std::string timestampPath = argv[2];
|
||||
std::string outPath = argv[3];
|
||||
std::string timestampPath = argv[1];
|
||||
std::string outPath = argv[2];
|
||||
|
||||
if (strlen(argv[4]) != 4)
|
||||
if (strlen(argv[3]) != 4)
|
||||
{
|
||||
fprintf(stderr, "File type ID must be 4 characters");
|
||||
return -2;
|
||||
}
|
||||
|
||||
if (strlen(argv[5]) != 4)
|
||||
if (strlen(argv[4]) != 4)
|
||||
{
|
||||
fprintf(stderr, "File creator ID must be 4 characters");
|
||||
return -3;
|
||||
@@ -47,10 +46,10 @@ int main(int argc, const char **argv)
|
||||
}
|
||||
|
||||
PortabilityLayer::MacFileProperties mfp;
|
||||
memcpy(mfp.m_fileType, argv[4], 4);
|
||||
memcpy(mfp.m_fileCreator, argv[5], 4);
|
||||
mfp.m_xPos = atoi(argv[6]);
|
||||
mfp.m_yPos = atoi(argv[7]);
|
||||
memcpy(mfp.m_fileType, argv[3], 4);
|
||||
memcpy(mfp.m_fileCreator, argv[4], 4);
|
||||
mfp.m_xPos = atoi(argv[5]);
|
||||
mfp.m_yPos = atoi(argv[6]);
|
||||
mfp.m_finderFlags = 0;
|
||||
mfp.m_protected = 0;
|
||||
mfp.m_modifiedDate = mfp.m_creationDate = timestamp;
|
||||
@@ -76,15 +75,11 @@ int main(int argc, const char **argv)
|
||||
mfp.m_finderFlags |= PortabilityLayer::FINDER_FILE_FLAG_INITED;
|
||||
}
|
||||
|
||||
std::string gpdPath = outPath + ".gpd";
|
||||
CopyFile(inPath.c_str(), gpdPath.c_str(), 0);
|
||||
|
||||
PortabilityLayer::MacFilePropertiesSerialized mps;
|
||||
mps.Serialize(mfp);
|
||||
|
||||
std::string gpfPath = outPath + ".gpf";
|
||||
FILE *file = nullptr;
|
||||
errno_t err = fopen_s(&file, gpfPath.c_str(), "wb");
|
||||
errno_t err = fopen_s(&file, outPath.c_str(), "wb");
|
||||
if (!err)
|
||||
{
|
||||
fwrite(mps.m_data, PortabilityLayer::MacFilePropertiesSerialized::kSize, 1, file);
|
||||
|
Reference in New Issue
Block a user