Example #1
0
        static void AddGPSDataToImage(string[] args)
        {
            if (args.Length < 2)
            {
                return;
            }

            //RCProjFile rcProj = new RCProjFile();
            //rcProj.LoadXML("E:\\CRSrcData\\Proj\\testWithXMPPos.rcproj");
            //rcProj.SetGroup();
            //rcProj.SaveXML("E:\\CRSrcData\\Proj\\testWithXMPPos.rcproj");

            ExifDataWriter exifWriter = new ExifDataWriter();

            AddLog("....Set Folder....");

            exifWriter.SetFolder(args[1]);
            if (args.Length >= 3)
            {
                AddLog("....Set Focal Length....");
                float f = (float)Convert.ToDouble(args[2]);
                exifWriter.SetFocalLen(f);
            }
            AddLog("....Process....");
            exifWriter.Process();

            if (args.Length >= 4)
            {
                if (args[3] == "1")
                {
                    AddLog("....Build XMP Files....");
                    exifWriter.BuildXMPFiles();
                    AddLog("....Run Exif Command....");
                    exifWriter.RunExifCommand();
                }
                else
                {
                    AddLog("....Build XMP Files....");
                    exifWriter.BuildXMPFiles();
                }
            }
            else
            {
                AddLog("....Run Exif Command....");
                exifWriter.RunExifCommand();
            }

            AddLog("....Clean Cache....");
            exifWriter.CleanCache(args[1]);
            //UE4Directory ue4Dir = new UE4Directory();
            //ue4Dir.Init();
            //ue4Dir.Command_BuildDerivedData();
            //UE4Directory.Run();
            AddLog("....Add GPS Data To Image....");
            return;
        }
Example #2
0
        static void BackupFolder(string[] args)
        {
            if (args.Length < 2)
            {
                return;
            }

            string src_folder = args[1];

            src_folder += "\\";
            string backup_folder = src_folder + "Backup\\";

            if (!Directory.Exists(backup_folder))
            {
                Directory.CreateDirectory(backup_folder);
                Program.AddLog("Create Folder: " + backup_folder);
            }

            string[] fileEntries = Directory.GetFiles(src_folder);
            foreach (string fileName in fileEntries)
            {
                string dest_filename = Path.GetFileName(fileName);
                dest_filename = backup_folder + dest_filename;
                File.Copy(fileName, dest_filename);
                Program.AddLog("Copy To: " + dest_filename);
            }
            //    Program.AddLog("exiftool " + arg);
            //    Program.AddLog(cmd.StandardOutput.ReadToEnd());
            //}
            if (args.Length < 4)
            {
                return;
            }
            int            step       = Convert.ToInt32(args[2]);
            int            isCheckSpd = Convert.ToInt32(args[3]);
            ExifDataWriter exifWriter = new ExifDataWriter();

            AddLog("....Set Folder....");

            exifWriter.SetFolder(args[1]);
            AddLog("....Process....");
            exifWriter.Process();

            // exifWriter.SelectImages(step,Convert.ToBoolean(isCheckSpd));
            return;
        }