Repair broken jpg files
Hi I'm sure there were a lot of similar questions asked, but after searching a lot I didn't find any post describing my situation.
I have some jpg files which have some colours wrong after a certain point and also every pixel is shifted to the left. I think this is because of some missing bytes at the point where it changes. I tried to edit the file with vi but it seems impossible to find out where the missing bytes are, also vi is very complicated to use. I also tried nano but it's not binary-safe.
This is one of the images in question:
So I want to ask you two questions:
- How can I repair such images in Linux?
- How could I safely open and edit the file in a binary text editor under Linux?
Edit:
using hexedit I discovered that from position 0x27F000 to 0x27F403 there are only ones 0xff, and from 0x27F404 to 0x27FFFF there are only zeroes 0x00.
This makes something like this:
0027EFF0 F8 83 C3 E2 09 35 AF 13 44 6E C5 FD C7 EF 23 E8 .....5..Dn....#.
0027F000 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
[...]
0027F400 FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 ................
[...]
0027FFF0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00280000 8F 39 6E 47 4F 43 5F 36 7C 73 66 F1 0D AE AD AF .9nGOC_6|sf.....
Changing these bytes with random numbers I was able to unshift the image, but there is still the colour problem.
Could someone point me to some documentation about jpeg encoding so I can figure out how to know where an 8x8 block ends.
I'm wondering why the positions are so precise (0x27F000 to 0x27FFFF), could this be a bug of my cam or the memory card I used?
linux jpeg
add a comment |
Hi I'm sure there were a lot of similar questions asked, but after searching a lot I didn't find any post describing my situation.
I have some jpg files which have some colours wrong after a certain point and also every pixel is shifted to the left. I think this is because of some missing bytes at the point where it changes. I tried to edit the file with vi but it seems impossible to find out where the missing bytes are, also vi is very complicated to use. I also tried nano but it's not binary-safe.
This is one of the images in question:
So I want to ask you two questions:
- How can I repair such images in Linux?
- How could I safely open and edit the file in a binary text editor under Linux?
Edit:
using hexedit I discovered that from position 0x27F000 to 0x27F403 there are only ones 0xff, and from 0x27F404 to 0x27FFFF there are only zeroes 0x00.
This makes something like this:
0027EFF0 F8 83 C3 E2 09 35 AF 13 44 6E C5 FD C7 EF 23 E8 .....5..Dn....#.
0027F000 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
[...]
0027F400 FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 ................
[...]
0027FFF0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00280000 8F 39 6E 47 4F 43 5F 36 7C 73 66 F1 0D AE AD AF .9nGOC_6|sf.....
Changing these bytes with random numbers I was able to unshift the image, but there is still the colour problem.
Could someone point me to some documentation about jpeg encoding so I can figure out how to know where an 8x8 block ends.
I'm wondering why the positions are so precise (0x27F000 to 0x27FFFF), could this be a bug of my cam or the memory card I used?
linux jpeg
I had this happen once to a large set of images. I just ended up deleting them, a shame really. I'd be interested to know if you succeed in repairing these, you've got a tough job ahead of you.
– dtmland
Jun 24 '13 at 20:16
Yes it is it's a shame, I'm trying to figure out how this jpeg files are encoded, it's just one 8x4000px line which I will have to delete. In this file there are exactly 4KB damaged in a file of 4.4MB It's less then 0.1%!!!
– Falk
Jun 25 '13 at 14:23
add a comment |
Hi I'm sure there were a lot of similar questions asked, but after searching a lot I didn't find any post describing my situation.
I have some jpg files which have some colours wrong after a certain point and also every pixel is shifted to the left. I think this is because of some missing bytes at the point where it changes. I tried to edit the file with vi but it seems impossible to find out where the missing bytes are, also vi is very complicated to use. I also tried nano but it's not binary-safe.
This is one of the images in question:
So I want to ask you two questions:
- How can I repair such images in Linux?
- How could I safely open and edit the file in a binary text editor under Linux?
Edit:
using hexedit I discovered that from position 0x27F000 to 0x27F403 there are only ones 0xff, and from 0x27F404 to 0x27FFFF there are only zeroes 0x00.
This makes something like this:
0027EFF0 F8 83 C3 E2 09 35 AF 13 44 6E C5 FD C7 EF 23 E8 .....5..Dn....#.
0027F000 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
[...]
0027F400 FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 ................
[...]
0027FFF0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00280000 8F 39 6E 47 4F 43 5F 36 7C 73 66 F1 0D AE AD AF .9nGOC_6|sf.....
Changing these bytes with random numbers I was able to unshift the image, but there is still the colour problem.
Could someone point me to some documentation about jpeg encoding so I can figure out how to know where an 8x8 block ends.
I'm wondering why the positions are so precise (0x27F000 to 0x27FFFF), could this be a bug of my cam or the memory card I used?
linux jpeg
Hi I'm sure there were a lot of similar questions asked, but after searching a lot I didn't find any post describing my situation.
I have some jpg files which have some colours wrong after a certain point and also every pixel is shifted to the left. I think this is because of some missing bytes at the point where it changes. I tried to edit the file with vi but it seems impossible to find out where the missing bytes are, also vi is very complicated to use. I also tried nano but it's not binary-safe.
This is one of the images in question:
So I want to ask you two questions:
- How can I repair such images in Linux?
- How could I safely open and edit the file in a binary text editor under Linux?
Edit:
using hexedit I discovered that from position 0x27F000 to 0x27F403 there are only ones 0xff, and from 0x27F404 to 0x27FFFF there are only zeroes 0x00.
This makes something like this:
0027EFF0 F8 83 C3 E2 09 35 AF 13 44 6E C5 FD C7 EF 23 E8 .....5..Dn....#.
0027F000 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
[...]
0027F400 FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 ................
[...]
0027FFF0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00280000 8F 39 6E 47 4F 43 5F 36 7C 73 66 F1 0D AE AD AF .9nGOC_6|sf.....
Changing these bytes with random numbers I was able to unshift the image, but there is still the colour problem.
Could someone point me to some documentation about jpeg encoding so I can figure out how to know where an 8x8 block ends.
I'm wondering why the positions are so precise (0x27F000 to 0x27FFFF), could this be a bug of my cam or the memory card I used?
linux jpeg
linux jpeg
edited Jun 24 '13 at 18:38
asked Jun 23 '13 at 13:23
Falk
21439
21439
I had this happen once to a large set of images. I just ended up deleting them, a shame really. I'd be interested to know if you succeed in repairing these, you've got a tough job ahead of you.
– dtmland
Jun 24 '13 at 20:16
Yes it is it's a shame, I'm trying to figure out how this jpeg files are encoded, it's just one 8x4000px line which I will have to delete. In this file there are exactly 4KB damaged in a file of 4.4MB It's less then 0.1%!!!
– Falk
Jun 25 '13 at 14:23
add a comment |
I had this happen once to a large set of images. I just ended up deleting them, a shame really. I'd be interested to know if you succeed in repairing these, you've got a tough job ahead of you.
– dtmland
Jun 24 '13 at 20:16
Yes it is it's a shame, I'm trying to figure out how this jpeg files are encoded, it's just one 8x4000px line which I will have to delete. In this file there are exactly 4KB damaged in a file of 4.4MB It's less then 0.1%!!!
– Falk
Jun 25 '13 at 14:23
I had this happen once to a large set of images. I just ended up deleting them, a shame really. I'd be interested to know if you succeed in repairing these, you've got a tough job ahead of you.
– dtmland
Jun 24 '13 at 20:16
I had this happen once to a large set of images. I just ended up deleting them, a shame really. I'd be interested to know if you succeed in repairing these, you've got a tough job ahead of you.
– dtmland
Jun 24 '13 at 20:16
Yes it is it's a shame, I'm trying to figure out how this jpeg files are encoded, it's just one 8x4000px line which I will have to delete. In this file there are exactly 4KB damaged in a file of 4.4MB It's less then 0.1%!!!
– Falk
Jun 25 '13 at 14:23
Yes it is it's a shame, I'm trying to figure out how this jpeg files are encoded, it's just one 8x4000px line which I will have to delete. In this file there are exactly 4KB damaged in a file of 4.4MB It's less then 0.1%!!!
– Falk
Jun 25 '13 at 14:23
add a comment |
3 Answers
3
active
oldest
votes
2) How could I safely open and edit the file in a binary text editor under Linux?
Lots of great binary editors can be found here:
https://stackoverflow.com/questions/839227/how-to-edit-binary-file-on-the-unix-systems
My personal favorites are vim with :%!xxd hack and hexedit
2
Ok, and something easier to use? like nano.
– Falk
Jun 24 '13 at 14:17
something easy likeshed
?
– Attie
Oct 24 '17 at 19:33
add a comment |
The wikipedia article on http://en.wikipedia.org/wiki/JPEG#Entropy_coding has a lot of information - the most relevant to your current problem is this one:
The previous quantized DC coefficient is used to predict the current quantized DC coefficient. The difference between the two is encoded rather than the actual value. The encoding of the 63 quantized AC coefficients does not use such prediction differencing.
The color shifting in the remainder of the image is caused by a single bad DC coefficient that cascades to all the rest. You might be able to find a small area (maybe one byte, maybe two - it's probably actually some sequence of bits) that reliably affects the colors, and try a large number of different values for that.
It may be easier to simply fix the image in a graphic editor - it looks like the one you posted, other than the shift (and wraparound), may simply have a lower brightness, you could select the area and use the Levels tool. Others that have more involved color shifts, you might be able to get a good enough result by looking at the decomposition in color channels (JPGs may be in RGB or Y'CbCr) and fixing each channel separately, possibly swapping channels.
EDIT: Oops, I didn't see how old your question was. Well, maybe this will be useful to you or someone else.
Lots of thanks,don’t care about the age of the question, is still have the image and some more.
– Falk
Jan 2 '15 at 22:49
I think it's a shame that the camera didn't expect such a situation, they should put some key blocks every n (say 32) rows of blocks. the other problem is that I even don't know if there is a lossless compression applied after the lossy one, like Huffman. I'd rather play around with some bytes than open the image with graphic editors: first most of them don't want to open these images, second I don't think that I could find the exact correction playing around with some sliders. @Random832 thanks and please tell me if You know something more.
– Falk
Jan 2 '15 at 23:09
add a comment |
Have you tried photorec
?
You can install it on Ubuntu like this:
sudo apt-get install testdisk
Check the manual with:
man photorec
and just run photorec
from the terminal like so:
photorec
It will ask you to select the source and a destination and try to recover jpg files automatically.
To prevent damaging the original, I recommend making a copy with the dd
command.
Good luck!
Hi, photorec is designed to recover files from a corrupted filesystem, in my case the filesystem is fine, but the image is corrupted so it's a totally different situation.
– Falk
Oct 24 '17 at 22:27
Hi, you can use fsck to check and repair the filesystem. I am not sure whether it is designed for it, but I got 1000+ recovered jpg files and others on a microSD card with damaged files that had an fsck run, so I would say give it a try if you care about the files :). Also, I stumbled upon this post because I had a similar error opening the image.
– Vincent Gerris
Oct 25 '17 at 12:05
2
Hi, as I wrote earlier there is nothing wrong with the filesystem, it's the JPEG file which has the error, thanks anyway.
– Falk
Oct 25 '17 at 13:03
as I wrote before, it works regardless. It's also mentioned in the man page: linux.die.net/man/1/photorec
– Vincent Gerris
Nov 1 '17 at 11:02
1
I'm just trying to help. You type would, so you didn't try? I actually ran it on an SD card and yes it copies them but it fixed them too. Can't hurt to try, right? If it's not worth trying, fine, good luck. All I am saying is that it did repair it for me. I will not respond any further to avoid endless discussion.
– Vincent Gerris
Nov 1 '17 at 15:24
|
show 2 more comments
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f611058%2frepair-broken-jpg-files%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
2) How could I safely open and edit the file in a binary text editor under Linux?
Lots of great binary editors can be found here:
https://stackoverflow.com/questions/839227/how-to-edit-binary-file-on-the-unix-systems
My personal favorites are vim with :%!xxd hack and hexedit
2
Ok, and something easier to use? like nano.
– Falk
Jun 24 '13 at 14:17
something easy likeshed
?
– Attie
Oct 24 '17 at 19:33
add a comment |
2) How could I safely open and edit the file in a binary text editor under Linux?
Lots of great binary editors can be found here:
https://stackoverflow.com/questions/839227/how-to-edit-binary-file-on-the-unix-systems
My personal favorites are vim with :%!xxd hack and hexedit
2
Ok, and something easier to use? like nano.
– Falk
Jun 24 '13 at 14:17
something easy likeshed
?
– Attie
Oct 24 '17 at 19:33
add a comment |
2) How could I safely open and edit the file in a binary text editor under Linux?
Lots of great binary editors can be found here:
https://stackoverflow.com/questions/839227/how-to-edit-binary-file-on-the-unix-systems
My personal favorites are vim with :%!xxd hack and hexedit
2) How could I safely open and edit the file in a binary text editor under Linux?
Lots of great binary editors can be found here:
https://stackoverflow.com/questions/839227/how-to-edit-binary-file-on-the-unix-systems
My personal favorites are vim with :%!xxd hack and hexedit
edited May 23 '17 at 12:41
Community♦
1
1
answered Jun 24 '13 at 13:08
Viacheslav Rodionov
19616
19616
2
Ok, and something easier to use? like nano.
– Falk
Jun 24 '13 at 14:17
something easy likeshed
?
– Attie
Oct 24 '17 at 19:33
add a comment |
2
Ok, and something easier to use? like nano.
– Falk
Jun 24 '13 at 14:17
something easy likeshed
?
– Attie
Oct 24 '17 at 19:33
2
2
Ok, and something easier to use? like nano.
– Falk
Jun 24 '13 at 14:17
Ok, and something easier to use? like nano.
– Falk
Jun 24 '13 at 14:17
something easy like
shed
?– Attie
Oct 24 '17 at 19:33
something easy like
shed
?– Attie
Oct 24 '17 at 19:33
add a comment |
The wikipedia article on http://en.wikipedia.org/wiki/JPEG#Entropy_coding has a lot of information - the most relevant to your current problem is this one:
The previous quantized DC coefficient is used to predict the current quantized DC coefficient. The difference between the two is encoded rather than the actual value. The encoding of the 63 quantized AC coefficients does not use such prediction differencing.
The color shifting in the remainder of the image is caused by a single bad DC coefficient that cascades to all the rest. You might be able to find a small area (maybe one byte, maybe two - it's probably actually some sequence of bits) that reliably affects the colors, and try a large number of different values for that.
It may be easier to simply fix the image in a graphic editor - it looks like the one you posted, other than the shift (and wraparound), may simply have a lower brightness, you could select the area and use the Levels tool. Others that have more involved color shifts, you might be able to get a good enough result by looking at the decomposition in color channels (JPGs may be in RGB or Y'CbCr) and fixing each channel separately, possibly swapping channels.
EDIT: Oops, I didn't see how old your question was. Well, maybe this will be useful to you or someone else.
Lots of thanks,don’t care about the age of the question, is still have the image and some more.
– Falk
Jan 2 '15 at 22:49
I think it's a shame that the camera didn't expect such a situation, they should put some key blocks every n (say 32) rows of blocks. the other problem is that I even don't know if there is a lossless compression applied after the lossy one, like Huffman. I'd rather play around with some bytes than open the image with graphic editors: first most of them don't want to open these images, second I don't think that I could find the exact correction playing around with some sliders. @Random832 thanks and please tell me if You know something more.
– Falk
Jan 2 '15 at 23:09
add a comment |
The wikipedia article on http://en.wikipedia.org/wiki/JPEG#Entropy_coding has a lot of information - the most relevant to your current problem is this one:
The previous quantized DC coefficient is used to predict the current quantized DC coefficient. The difference between the two is encoded rather than the actual value. The encoding of the 63 quantized AC coefficients does not use such prediction differencing.
The color shifting in the remainder of the image is caused by a single bad DC coefficient that cascades to all the rest. You might be able to find a small area (maybe one byte, maybe two - it's probably actually some sequence of bits) that reliably affects the colors, and try a large number of different values for that.
It may be easier to simply fix the image in a graphic editor - it looks like the one you posted, other than the shift (and wraparound), may simply have a lower brightness, you could select the area and use the Levels tool. Others that have more involved color shifts, you might be able to get a good enough result by looking at the decomposition in color channels (JPGs may be in RGB or Y'CbCr) and fixing each channel separately, possibly swapping channels.
EDIT: Oops, I didn't see how old your question was. Well, maybe this will be useful to you or someone else.
Lots of thanks,don’t care about the age of the question, is still have the image and some more.
– Falk
Jan 2 '15 at 22:49
I think it's a shame that the camera didn't expect such a situation, they should put some key blocks every n (say 32) rows of blocks. the other problem is that I even don't know if there is a lossless compression applied after the lossy one, like Huffman. I'd rather play around with some bytes than open the image with graphic editors: first most of them don't want to open these images, second I don't think that I could find the exact correction playing around with some sliders. @Random832 thanks and please tell me if You know something more.
– Falk
Jan 2 '15 at 23:09
add a comment |
The wikipedia article on http://en.wikipedia.org/wiki/JPEG#Entropy_coding has a lot of information - the most relevant to your current problem is this one:
The previous quantized DC coefficient is used to predict the current quantized DC coefficient. The difference between the two is encoded rather than the actual value. The encoding of the 63 quantized AC coefficients does not use such prediction differencing.
The color shifting in the remainder of the image is caused by a single bad DC coefficient that cascades to all the rest. You might be able to find a small area (maybe one byte, maybe two - it's probably actually some sequence of bits) that reliably affects the colors, and try a large number of different values for that.
It may be easier to simply fix the image in a graphic editor - it looks like the one you posted, other than the shift (and wraparound), may simply have a lower brightness, you could select the area and use the Levels tool. Others that have more involved color shifts, you might be able to get a good enough result by looking at the decomposition in color channels (JPGs may be in RGB or Y'CbCr) and fixing each channel separately, possibly swapping channels.
EDIT: Oops, I didn't see how old your question was. Well, maybe this will be useful to you or someone else.
The wikipedia article on http://en.wikipedia.org/wiki/JPEG#Entropy_coding has a lot of information - the most relevant to your current problem is this one:
The previous quantized DC coefficient is used to predict the current quantized DC coefficient. The difference between the two is encoded rather than the actual value. The encoding of the 63 quantized AC coefficients does not use such prediction differencing.
The color shifting in the remainder of the image is caused by a single bad DC coefficient that cascades to all the rest. You might be able to find a small area (maybe one byte, maybe two - it's probably actually some sequence of bits) that reliably affects the colors, and try a large number of different values for that.
It may be easier to simply fix the image in a graphic editor - it looks like the one you posted, other than the shift (and wraparound), may simply have a lower brightness, you could select the area and use the Levels tool. Others that have more involved color shifts, you might be able to get a good enough result by looking at the decomposition in color channels (JPGs may be in RGB or Y'CbCr) and fixing each channel separately, possibly swapping channels.
EDIT: Oops, I didn't see how old your question was. Well, maybe this will be useful to you or someone else.
answered Jan 1 '15 at 6:57
Random832
58139
58139
Lots of thanks,don’t care about the age of the question, is still have the image and some more.
– Falk
Jan 2 '15 at 22:49
I think it's a shame that the camera didn't expect such a situation, they should put some key blocks every n (say 32) rows of blocks. the other problem is that I even don't know if there is a lossless compression applied after the lossy one, like Huffman. I'd rather play around with some bytes than open the image with graphic editors: first most of them don't want to open these images, second I don't think that I could find the exact correction playing around with some sliders. @Random832 thanks and please tell me if You know something more.
– Falk
Jan 2 '15 at 23:09
add a comment |
Lots of thanks,don’t care about the age of the question, is still have the image and some more.
– Falk
Jan 2 '15 at 22:49
I think it's a shame that the camera didn't expect such a situation, they should put some key blocks every n (say 32) rows of blocks. the other problem is that I even don't know if there is a lossless compression applied after the lossy one, like Huffman. I'd rather play around with some bytes than open the image with graphic editors: first most of them don't want to open these images, second I don't think that I could find the exact correction playing around with some sliders. @Random832 thanks and please tell me if You know something more.
– Falk
Jan 2 '15 at 23:09
Lots of thanks,don’t care about the age of the question, is still have the image and some more.
– Falk
Jan 2 '15 at 22:49
Lots of thanks,don’t care about the age of the question, is still have the image and some more.
– Falk
Jan 2 '15 at 22:49
I think it's a shame that the camera didn't expect such a situation, they should put some key blocks every n (say 32) rows of blocks. the other problem is that I even don't know if there is a lossless compression applied after the lossy one, like Huffman. I'd rather play around with some bytes than open the image with graphic editors: first most of them don't want to open these images, second I don't think that I could find the exact correction playing around with some sliders. @Random832 thanks and please tell me if You know something more.
– Falk
Jan 2 '15 at 23:09
I think it's a shame that the camera didn't expect such a situation, they should put some key blocks every n (say 32) rows of blocks. the other problem is that I even don't know if there is a lossless compression applied after the lossy one, like Huffman. I'd rather play around with some bytes than open the image with graphic editors: first most of them don't want to open these images, second I don't think that I could find the exact correction playing around with some sliders. @Random832 thanks and please tell me if You know something more.
– Falk
Jan 2 '15 at 23:09
add a comment |
Have you tried photorec
?
You can install it on Ubuntu like this:
sudo apt-get install testdisk
Check the manual with:
man photorec
and just run photorec
from the terminal like so:
photorec
It will ask you to select the source and a destination and try to recover jpg files automatically.
To prevent damaging the original, I recommend making a copy with the dd
command.
Good luck!
Hi, photorec is designed to recover files from a corrupted filesystem, in my case the filesystem is fine, but the image is corrupted so it's a totally different situation.
– Falk
Oct 24 '17 at 22:27
Hi, you can use fsck to check and repair the filesystem. I am not sure whether it is designed for it, but I got 1000+ recovered jpg files and others on a microSD card with damaged files that had an fsck run, so I would say give it a try if you care about the files :). Also, I stumbled upon this post because I had a similar error opening the image.
– Vincent Gerris
Oct 25 '17 at 12:05
2
Hi, as I wrote earlier there is nothing wrong with the filesystem, it's the JPEG file which has the error, thanks anyway.
– Falk
Oct 25 '17 at 13:03
as I wrote before, it works regardless. It's also mentioned in the man page: linux.die.net/man/1/photorec
– Vincent Gerris
Nov 1 '17 at 11:02
1
I'm just trying to help. You type would, so you didn't try? I actually ran it on an SD card and yes it copies them but it fixed them too. Can't hurt to try, right? If it's not worth trying, fine, good luck. All I am saying is that it did repair it for me. I will not respond any further to avoid endless discussion.
– Vincent Gerris
Nov 1 '17 at 15:24
|
show 2 more comments
Have you tried photorec
?
You can install it on Ubuntu like this:
sudo apt-get install testdisk
Check the manual with:
man photorec
and just run photorec
from the terminal like so:
photorec
It will ask you to select the source and a destination and try to recover jpg files automatically.
To prevent damaging the original, I recommend making a copy with the dd
command.
Good luck!
Hi, photorec is designed to recover files from a corrupted filesystem, in my case the filesystem is fine, but the image is corrupted so it's a totally different situation.
– Falk
Oct 24 '17 at 22:27
Hi, you can use fsck to check and repair the filesystem. I am not sure whether it is designed for it, but I got 1000+ recovered jpg files and others on a microSD card with damaged files that had an fsck run, so I would say give it a try if you care about the files :). Also, I stumbled upon this post because I had a similar error opening the image.
– Vincent Gerris
Oct 25 '17 at 12:05
2
Hi, as I wrote earlier there is nothing wrong with the filesystem, it's the JPEG file which has the error, thanks anyway.
– Falk
Oct 25 '17 at 13:03
as I wrote before, it works regardless. It's also mentioned in the man page: linux.die.net/man/1/photorec
– Vincent Gerris
Nov 1 '17 at 11:02
1
I'm just trying to help. You type would, so you didn't try? I actually ran it on an SD card and yes it copies them but it fixed them too. Can't hurt to try, right? If it's not worth trying, fine, good luck. All I am saying is that it did repair it for me. I will not respond any further to avoid endless discussion.
– Vincent Gerris
Nov 1 '17 at 15:24
|
show 2 more comments
Have you tried photorec
?
You can install it on Ubuntu like this:
sudo apt-get install testdisk
Check the manual with:
man photorec
and just run photorec
from the terminal like so:
photorec
It will ask you to select the source and a destination and try to recover jpg files automatically.
To prevent damaging the original, I recommend making a copy with the dd
command.
Good luck!
Have you tried photorec
?
You can install it on Ubuntu like this:
sudo apt-get install testdisk
Check the manual with:
man photorec
and just run photorec
from the terminal like so:
photorec
It will ask you to select the source and a destination and try to recover jpg files automatically.
To prevent damaging the original, I recommend making a copy with the dd
command.
Good luck!
edited Dec 8 at 15:22
Itai Steinherz
32
32
answered Oct 24 '17 at 19:29
Vincent Gerris
1111
1111
Hi, photorec is designed to recover files from a corrupted filesystem, in my case the filesystem is fine, but the image is corrupted so it's a totally different situation.
– Falk
Oct 24 '17 at 22:27
Hi, you can use fsck to check and repair the filesystem. I am not sure whether it is designed for it, but I got 1000+ recovered jpg files and others on a microSD card with damaged files that had an fsck run, so I would say give it a try if you care about the files :). Also, I stumbled upon this post because I had a similar error opening the image.
– Vincent Gerris
Oct 25 '17 at 12:05
2
Hi, as I wrote earlier there is nothing wrong with the filesystem, it's the JPEG file which has the error, thanks anyway.
– Falk
Oct 25 '17 at 13:03
as I wrote before, it works regardless. It's also mentioned in the man page: linux.die.net/man/1/photorec
– Vincent Gerris
Nov 1 '17 at 11:02
1
I'm just trying to help. You type would, so you didn't try? I actually ran it on an SD card and yes it copies them but it fixed them too. Can't hurt to try, right? If it's not worth trying, fine, good luck. All I am saying is that it did repair it for me. I will not respond any further to avoid endless discussion.
– Vincent Gerris
Nov 1 '17 at 15:24
|
show 2 more comments
Hi, photorec is designed to recover files from a corrupted filesystem, in my case the filesystem is fine, but the image is corrupted so it's a totally different situation.
– Falk
Oct 24 '17 at 22:27
Hi, you can use fsck to check and repair the filesystem. I am not sure whether it is designed for it, but I got 1000+ recovered jpg files and others on a microSD card with damaged files that had an fsck run, so I would say give it a try if you care about the files :). Also, I stumbled upon this post because I had a similar error opening the image.
– Vincent Gerris
Oct 25 '17 at 12:05
2
Hi, as I wrote earlier there is nothing wrong with the filesystem, it's the JPEG file which has the error, thanks anyway.
– Falk
Oct 25 '17 at 13:03
as I wrote before, it works regardless. It's also mentioned in the man page: linux.die.net/man/1/photorec
– Vincent Gerris
Nov 1 '17 at 11:02
1
I'm just trying to help. You type would, so you didn't try? I actually ran it on an SD card and yes it copies them but it fixed them too. Can't hurt to try, right? If it's not worth trying, fine, good luck. All I am saying is that it did repair it for me. I will not respond any further to avoid endless discussion.
– Vincent Gerris
Nov 1 '17 at 15:24
Hi, photorec is designed to recover files from a corrupted filesystem, in my case the filesystem is fine, but the image is corrupted so it's a totally different situation.
– Falk
Oct 24 '17 at 22:27
Hi, photorec is designed to recover files from a corrupted filesystem, in my case the filesystem is fine, but the image is corrupted so it's a totally different situation.
– Falk
Oct 24 '17 at 22:27
Hi, you can use fsck to check and repair the filesystem. I am not sure whether it is designed for it, but I got 1000+ recovered jpg files and others on a microSD card with damaged files that had an fsck run, so I would say give it a try if you care about the files :). Also, I stumbled upon this post because I had a similar error opening the image.
– Vincent Gerris
Oct 25 '17 at 12:05
Hi, you can use fsck to check and repair the filesystem. I am not sure whether it is designed for it, but I got 1000+ recovered jpg files and others on a microSD card with damaged files that had an fsck run, so I would say give it a try if you care about the files :). Also, I stumbled upon this post because I had a similar error opening the image.
– Vincent Gerris
Oct 25 '17 at 12:05
2
2
Hi, as I wrote earlier there is nothing wrong with the filesystem, it's the JPEG file which has the error, thanks anyway.
– Falk
Oct 25 '17 at 13:03
Hi, as I wrote earlier there is nothing wrong with the filesystem, it's the JPEG file which has the error, thanks anyway.
– Falk
Oct 25 '17 at 13:03
as I wrote before, it works regardless. It's also mentioned in the man page: linux.die.net/man/1/photorec
– Vincent Gerris
Nov 1 '17 at 11:02
as I wrote before, it works regardless. It's also mentioned in the man page: linux.die.net/man/1/photorec
– Vincent Gerris
Nov 1 '17 at 11:02
1
1
I'm just trying to help. You type would, so you didn't try? I actually ran it on an SD card and yes it copies them but it fixed them too. Can't hurt to try, right? If it's not worth trying, fine, good luck. All I am saying is that it did repair it for me. I will not respond any further to avoid endless discussion.
– Vincent Gerris
Nov 1 '17 at 15:24
I'm just trying to help. You type would, so you didn't try? I actually ran it on an SD card and yes it copies them but it fixed them too. Can't hurt to try, right? If it's not worth trying, fine, good luck. All I am saying is that it did repair it for me. I will not respond any further to avoid endless discussion.
– Vincent Gerris
Nov 1 '17 at 15:24
|
show 2 more comments
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f611058%2frepair-broken-jpg-files%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I had this happen once to a large set of images. I just ended up deleting them, a shame really. I'd be interested to know if you succeed in repairing these, you've got a tough job ahead of you.
– dtmland
Jun 24 '13 at 20:16
Yes it is it's a shame, I'm trying to figure out how this jpeg files are encoded, it's just one 8x4000px line which I will have to delete. In this file there are exactly 4KB damaged in a file of 4.4MB It's less then 0.1%!!!
– Falk
Jun 25 '13 at 14:23