Josh Posted 1 hour ago Posted 1 hour ago Script you can run from the editor when you need it: path = RequestDir("Open Folder", program.project.path.."/") local files = LoadDir(path) local n local count = 0 for n = 1, #files do if FileType(path.."/"..files[n]) == 1 then if Lower(ExtractExt(path.."/"..files[n])) == "png" then local pixmap = LoadPixmap(path.."/"..files[n]) if pixmap then if pixmap.size.x > 2048 or pixmap.size.y > 2048 then if pixmap.size.x > pixmap.size.y then pixmap = pixmap:Resize(2048, 2048 * (pixmap.size.y / pixmap.size.x)) else pixmap = pixmap:Resize(2048 * (pixmap.size.x / pixmap.size.y), 2048) end pixmap:Save(path.."/"..files[n]) count = count + 1 end end end end end Notify("Resized "..tostring(count).." images") Quote Let's build cool stuff and have fun.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.