{"id":31862,"date":"2024-02-14T17:30:12","date_gmt":"2024-02-14T22:30:12","guid":{"rendered":"https:\/\/ckms.ca\/?p=31862"},"modified":"2024-02-14T17:30:31","modified_gmt":"2024-02-14T22:30:31","slug":"how-i-rename-files-convert-to-jpg-etc","status":"publish","type":"post","link":"https:\/\/blog.ckms.ca\/?p=31862","title":{"rendered":"how i rename files, convert to .jpg, etc."},"content":{"rendered":"\n<p>the command file: <strong>fix-downloads.cmd<\/strong> does the following:<\/p>\n\n\n\n<p>rename .jpeg to .jpg<\/p>\n\n\n\n<p>convert all the graphics files (PNG, JFIF, BMP, others?) in the current directory to .JPG<br><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>fix-downloads.cmd<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@echo off\r\n::\r\n:: rename all .JPEG -> .JPG\r\n:: convert all the graphics files in the current directory to .JPG\r\n::\r\n:: PNG, JFIF, BMP,\r\n::\r\n::\r\n:: we'll do them one at a time so we can catch errors; irfanview can do them as a\r\n:: batch, but not sure how to handles errors\r\n::\r\n:: TO-DO: but how to get the errocode fromirfanview when it's in a for loop?  i think will need to\r\n::        create another .CMD file that does the conversion on a passed filename and does the errorcode\r\n::        check there, not here.\r\n::\r\n:: for now, just do the conversions in place, leaving the old files; to know the original format,\r\n:: leave the original extension (foo.png -> foo.png.JPG\r\n::\r\n:: first renaname any .jepg to .jpg as the lord intended...\r\n\r\nfor %%x in (*.jpeg) do ren %%x %%x.jpg\r\n\r\nfor %%x in (*.png) do \"C:\\Program Files\\IrfanView\\i_view64.exe\" %%x \/convert=%%x.jpg\r\n\r\nfor %%x in (*.bmp) do \"C:\\Program Files\\IrfanView\\i_view64.exe\" %%x \/convert=%%x.jpg\r\n\r\nfor %%x in (*.jfif) do \"C:\\Program Files\\IrfanView\\i_view64.exe\" %%x \/convert=%%x.jpg<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>the command file: fix-downloads.cmd does the following: rename .jpeg to .jpg convert&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[282],"tags":[1657],"class_list":["post-31862","post","type-post","status-publish","format-standard","hentry","category-article","tag-how-i","wpcat-282-id"],"_links":{"self":[{"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=\/wp\/v2\/posts\/31862","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=31862"}],"version-history":[{"count":1,"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=\/wp\/v2\/posts\/31862\/revisions"}],"predecessor-version":[{"id":31863,"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=\/wp\/v2\/posts\/31862\/revisions\/31863"}],"wp:attachment":[{"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=31862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=31862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=31862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}