VBAHole22 Posted September 28, 2004 Posted September 28, 2004 Is there any easy way to find out if a file is compressed? I have some tif images that are compressed and some that I need to compress. How can I differentiate which are which in code? I can right click in windows exploder and see the compression attribute but how can I get at it in code? Quote Wanna-Be C# Superstar
Administrators PlausiblyDamp Posted September 28, 2004 Administrators Posted September 28, 2004 If you are simply refering to NTFS compression via explorer rather than any internal TIFF compression the following should do the trick. If System.IO.File.GetAttributes("c:\autoexec.bat") And IO.FileAttributes.Compressed = IO.FileAttributes.Compressed Then MessageBox.Show("Compressed") End If Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
VBAHole22 Posted September 28, 2004 Author Posted September 28, 2004 The property I'm refering to is under the image tab when I right-click on the file and select properties in explorer (win2k). That code is very interesting. How does it work? Unfortunately it's returning compressed for all of my files including the ones that are uncompressed in the image>compression property I mentioned above. Quote Wanna-Be C# Superstar
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.