Results 1 to 5 of 5

Thread: Need help finding corrupy image files

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2011
    Posts
    498

    Need help finding corrupy image files

    sometimes i find jpg images that are not complete.
    ie if i open the file then i may only get half a picture.

    is there any way to know progmatically that the file is corrupt.

    ie search for corrupt files

    tks

  2. #2
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Need help finding corrupy image files

    It's technically not corrupt if it can be opened without error.

    I don't know what your exact circumstances are but the traditional way to detect errors in files is to use hashing. You hash the original file and if the hash of any copy doesn't match the hash of the original, then it means there was corruption but like I said, I don't know what your circumstances are. I don't know if you have an un-corrupted original version to use for comparison.

    I think you need to provide some context for your question.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2011
    Posts
    498

    Re: Need help finding corrupy image files

    Quote Originally Posted by Niya View Post
    It's technically not corrupt if it can be opened without error.

    I don't know what your exact circumstances are but the traditional way to detect errors in files is to use hashing. You hash the original file and if the hash of any copy doesn't match the hash of the original, then it means there was corruption but like I said, I don't know what your circumstances are. I don't know if you have an un-corrupted original version to use for comparison.

    I think you need to provide some context for your question.
    tks for reply. so i have lots of photos that were at one stage on an sd card. these were copied a long time ago.
    At some point the sd card had curruption and some images are not complete.

    They open but only have partial image.
    But some cannot be opened in Irfanview and gives error msg
    Attachment 186894 with 5.50MB taken up

    How would i detect this same error in VB

    currently my app shows no image and image has no Dimesions. would it be fair to say i can rely on the dimensions being Zero

    tks

  4. #4
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Need help finding corrupy image files

    The ones that cannot be opened are easy. You just trap the error in VB6 using On Error Goto traps.

    The ones that can be opened I guess you could test for oddities like 0 length dimensions.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  5. #5
    Hyperactive Member
    Join Date
    Sep 2014
    Posts
    373

    Re: Need help finding corrupy image files

    Upload one of your corrupted JPG files (a small one is preferred); I would like to see if I can spot the cause.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width