jcarve 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- jcarve-0.1.0/LICENSE +21 -0
- jcarve-0.1.0/PKG-INFO +121 -0
- jcarve-0.1.0/README.md +93 -0
- jcarve-0.1.0/jcarve/__init__.py +2 -0
- jcarve-0.1.0/jcarve/__main__.py +5 -0
- jcarve-0.1.0/jcarve/app.py +445 -0
- jcarve-0.1.0/jcarve/carve.py +654 -0
- jcarve-0.1.0/jcarve/geom.py +200 -0
- jcarve-0.1.0/jcarve/jhuff.py +251 -0
- jcarve-0.1.0/jcarve/redate.py +232 -0
- jcarve-0.1.0/jcarve/ui.py +20 -0
- jcarve-0.1.0/jcarve.egg-info/PKG-INFO +121 -0
- jcarve-0.1.0/jcarve.egg-info/SOURCES.txt +17 -0
- jcarve-0.1.0/jcarve.egg-info/dependency_links.txt +1 -0
- jcarve-0.1.0/jcarve.egg-info/entry_points.txt +4 -0
- jcarve-0.1.0/jcarve.egg-info/requires.txt +5 -0
- jcarve-0.1.0/jcarve.egg-info/top_level.txt +1 -0
- jcarve-0.1.0/pyproject.toml +49 -0
- jcarve-0.1.0/setup.cfg +4 -0
jcarve-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Michael Yushchuk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
jcarve-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jcarve
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Fix recovered photos that are grey below the top part: reassembles fragmented JPEGs that PhotoRec only partially recovers.
|
|
5
|
+
Author: Michael Yushchuk
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Justdjent/jcarve
|
|
8
|
+
Project-URL: Issues, https://github.com/Justdjent/jcarve/issues
|
|
9
|
+
Keywords: data recovery,photo recovery,file carving,jpeg,photorec,digital forensics,sd card,exfat,fragmented files,undelete
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
13
|
+
Classifier: Intended Audience :: Information Technology
|
|
14
|
+
Classifier: Operating System :: MacOS
|
|
15
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Topic :: Multimedia :: Graphics
|
|
18
|
+
Classifier: Topic :: Security
|
|
19
|
+
Classifier: Topic :: System :: Recovery Tools
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: pillow>=9
|
|
24
|
+
Provides-Extra: ui
|
|
25
|
+
Requires-Dist: streamlit>=1.30; extra == "ui"
|
|
26
|
+
Requires-Dist: numpy>=1.24; extra == "ui"
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# jcarve
|
|
30
|
+
|
|
31
|
+
**Recovered your photos, but they're grey from partway down?** jcarve finds the
|
|
32
|
+
missing pieces on the card and puts them back.
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+
|
|
36
|
+
Recovery tools such as PhotoRec read each photo as one unbroken run of data.
|
|
37
|
+
On a well-used card the camera often stored a photo in several pieces scattered
|
|
38
|
+
across the card, so the tool recovers the first piece and fills the rest with
|
|
39
|
+
whatever came next: you get the top of the picture, and grey or garbage below.
|
|
40
|
+
jcarve searches the card image for the missing pieces, checks each candidate
|
|
41
|
+
against the picture it would continue, and reassembles the file.
|
|
42
|
+
|
|
43
|
+
On one real card (Sony A7C II, exFAT, 2,624 full-size photos) it recovered
|
|
44
|
+
**2,502 photos completely (95.4%)**, including 350 that had to be rebuilt from 2
|
|
45
|
+
to 31 scattered pieces.
|
|
46
|
+
|
|
47
|
+
| | |
|
|
48
|
+
|---|---|
|
|
49
|
+
|  |  |
|
|
50
|
+
|
|
51
|
+
*Left of each pair: the file a contiguous carver writes, rebuilt from the same
|
|
52
|
+
card image. Right: jcarve's output.*
|
|
53
|
+
|
|
54
|
+
## Quick start
|
|
55
|
+
|
|
56
|
+
**1. Install** (Python 3.9+):
|
|
57
|
+
|
|
58
|
+
pip install jcarve # command line
|
|
59
|
+
pip install "jcarve[ui]" # plus the browser interface
|
|
60
|
+
|
|
61
|
+
**2. Image the card.** Never work on the card itself — make a copy and leave the
|
|
62
|
+
card alone. [GNU ddrescue](https://www.gnu.org/software/ddrescue/) copes with
|
|
63
|
+
bad sectors and can resume. You need free space equal to the card's size.
|
|
64
|
+
|
|
65
|
+
# macOS -- find the card (e.g. disk4), then copy the raw device
|
|
66
|
+
diskutil list
|
|
67
|
+
diskutil unmountDisk /dev/disk4
|
|
68
|
+
brew install ddrescue
|
|
69
|
+
sudo ddrescue /dev/rdisk4 card.img card.map
|
|
70
|
+
|
|
71
|
+
# Linux -- find the card (e.g. sdb)
|
|
72
|
+
lsblk
|
|
73
|
+
sudo ddrescue -d /dev/sdb card.img card.map
|
|
74
|
+
|
|
75
|
+
Double-check the device name, and keep the order: **the card first, the image
|
|
76
|
+
file second.** ddrescue writes to its second argument.
|
|
77
|
+
|
|
78
|
+
**3. Recover:**
|
|
79
|
+
|
|
80
|
+
jcarve index card.img # one pass; reads the geometry itself
|
|
81
|
+
jcarve list card.img # what was found: ids, dates, sizes
|
|
82
|
+
jcarve recover card.img recovered/ --ids 12,40,41 # omit --ids to recover everything
|
|
83
|
+
|
|
84
|
+
A card holds far more JPEG headers than photos: cameras embed thumbnails and
|
|
85
|
+
previews in every file, and on the card above they outnumbered full-size frames
|
|
86
|
+
almost two to one. `list` shows all of them. The browser interface filters by
|
|
87
|
+
size and date before recovering, which is the easier way to choose.
|
|
88
|
+
|
|
89
|
+
**4. Optionally restore the dates**, so the output sorts by when each photo was
|
|
90
|
+
taken rather than when it was recovered:
|
|
91
|
+
|
|
92
|
+
jcarve-redate recovered/ --in-place
|
|
93
|
+
|
|
94
|
+
Or do all of it from the browser: `jcarve-ui`.
|
|
95
|
+
|
|
96
|
+
## What to expect
|
|
97
|
+
|
|
98
|
+
- **It is slow.** Every photo is decoded end to end: about 2 minutes of CPU for
|
|
99
|
+
one stored in a single piece, typically 10–15 for one that needs reassembly,
|
|
100
|
+
and occasionally over an hour. Photos run in parallel across your cores; the
|
|
101
|
+
card above took 27 hours on an 8-core laptop. `index` is limited by your drive's
|
|
102
|
+
read speed — about 80 minutes for 500 GB over USB 3.
|
|
103
|
+
- **Baseline JPEG only**, which is what cameras write. Progressive JPEGs are
|
|
104
|
+
rejected rather than mis-parsed. RAW files are not handled.
|
|
105
|
+
- **exFAT, FAT and NTFS** geometry is read automatically; anything else can be
|
|
106
|
+
inferred (`jcarve detect`) or given with `--cluster` / `--data-offset`.
|
|
107
|
+
- **Tested on macOS.** Linux should work but has not been verified;
|
|
108
|
+
`jcarve-redate`'s creation-date step is macOS-only.
|
|
109
|
+
- A photo can stay partial if its missing pieces were overwritten, or lie
|
|
110
|
+
beyond the search limits (see [Search limits](https://github.com/Justdjent/jcarve/blob/main/docs/TECHNICAL.md#search-limits)). Partial
|
|
111
|
+
results are always written out.
|
|
112
|
+
|
|
113
|
+
## Learn more
|
|
114
|
+
|
|
115
|
+
[Technical details](https://github.com/Justdjent/jcarve/blob/main/docs/TECHNICAL.md) — every command and option, the browser interface,
|
|
116
|
+
restoring dates, how the reassembly works, performance, and how it compares with
|
|
117
|
+
published recovery methods.
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
MIT — see [LICENSE](https://github.com/Justdjent/jcarve/blob/main/LICENSE).
|
jcarve-0.1.0/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# jcarve
|
|
2
|
+
|
|
3
|
+
**Recovered your photos, but they're grey from partway down?** jcarve finds the
|
|
4
|
+
missing pieces on the card and puts them back.
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
Recovery tools such as PhotoRec read each photo as one unbroken run of data.
|
|
9
|
+
On a well-used card the camera often stored a photo in several pieces scattered
|
|
10
|
+
across the card, so the tool recovers the first piece and fills the rest with
|
|
11
|
+
whatever came next: you get the top of the picture, and grey or garbage below.
|
|
12
|
+
jcarve searches the card image for the missing pieces, checks each candidate
|
|
13
|
+
against the picture it would continue, and reassembles the file.
|
|
14
|
+
|
|
15
|
+
On one real card (Sony A7C II, exFAT, 2,624 full-size photos) it recovered
|
|
16
|
+
**2,502 photos completely (95.4%)**, including 350 that had to be rebuilt from 2
|
|
17
|
+
to 31 scattered pieces.
|
|
18
|
+
|
|
19
|
+
| | |
|
|
20
|
+
|---|---|
|
|
21
|
+
|  |  |
|
|
22
|
+
|
|
23
|
+
*Left of each pair: the file a contiguous carver writes, rebuilt from the same
|
|
24
|
+
card image. Right: jcarve's output.*
|
|
25
|
+
|
|
26
|
+
## Quick start
|
|
27
|
+
|
|
28
|
+
**1. Install** (Python 3.9+):
|
|
29
|
+
|
|
30
|
+
pip install jcarve # command line
|
|
31
|
+
pip install "jcarve[ui]" # plus the browser interface
|
|
32
|
+
|
|
33
|
+
**2. Image the card.** Never work on the card itself — make a copy and leave the
|
|
34
|
+
card alone. [GNU ddrescue](https://www.gnu.org/software/ddrescue/) copes with
|
|
35
|
+
bad sectors and can resume. You need free space equal to the card's size.
|
|
36
|
+
|
|
37
|
+
# macOS -- find the card (e.g. disk4), then copy the raw device
|
|
38
|
+
diskutil list
|
|
39
|
+
diskutil unmountDisk /dev/disk4
|
|
40
|
+
brew install ddrescue
|
|
41
|
+
sudo ddrescue /dev/rdisk4 card.img card.map
|
|
42
|
+
|
|
43
|
+
# Linux -- find the card (e.g. sdb)
|
|
44
|
+
lsblk
|
|
45
|
+
sudo ddrescue -d /dev/sdb card.img card.map
|
|
46
|
+
|
|
47
|
+
Double-check the device name, and keep the order: **the card first, the image
|
|
48
|
+
file second.** ddrescue writes to its second argument.
|
|
49
|
+
|
|
50
|
+
**3. Recover:**
|
|
51
|
+
|
|
52
|
+
jcarve index card.img # one pass; reads the geometry itself
|
|
53
|
+
jcarve list card.img # what was found: ids, dates, sizes
|
|
54
|
+
jcarve recover card.img recovered/ --ids 12,40,41 # omit --ids to recover everything
|
|
55
|
+
|
|
56
|
+
A card holds far more JPEG headers than photos: cameras embed thumbnails and
|
|
57
|
+
previews in every file, and on the card above they outnumbered full-size frames
|
|
58
|
+
almost two to one. `list` shows all of them. The browser interface filters by
|
|
59
|
+
size and date before recovering, which is the easier way to choose.
|
|
60
|
+
|
|
61
|
+
**4. Optionally restore the dates**, so the output sorts by when each photo was
|
|
62
|
+
taken rather than when it was recovered:
|
|
63
|
+
|
|
64
|
+
jcarve-redate recovered/ --in-place
|
|
65
|
+
|
|
66
|
+
Or do all of it from the browser: `jcarve-ui`.
|
|
67
|
+
|
|
68
|
+
## What to expect
|
|
69
|
+
|
|
70
|
+
- **It is slow.** Every photo is decoded end to end: about 2 minutes of CPU for
|
|
71
|
+
one stored in a single piece, typically 10–15 for one that needs reassembly,
|
|
72
|
+
and occasionally over an hour. Photos run in parallel across your cores; the
|
|
73
|
+
card above took 27 hours on an 8-core laptop. `index` is limited by your drive's
|
|
74
|
+
read speed — about 80 minutes for 500 GB over USB 3.
|
|
75
|
+
- **Baseline JPEG only**, which is what cameras write. Progressive JPEGs are
|
|
76
|
+
rejected rather than mis-parsed. RAW files are not handled.
|
|
77
|
+
- **exFAT, FAT and NTFS** geometry is read automatically; anything else can be
|
|
78
|
+
inferred (`jcarve detect`) or given with `--cluster` / `--data-offset`.
|
|
79
|
+
- **Tested on macOS.** Linux should work but has not been verified;
|
|
80
|
+
`jcarve-redate`'s creation-date step is macOS-only.
|
|
81
|
+
- A photo can stay partial if its missing pieces were overwritten, or lie
|
|
82
|
+
beyond the search limits (see [Search limits](https://github.com/Justdjent/jcarve/blob/main/docs/TECHNICAL.md#search-limits)). Partial
|
|
83
|
+
results are always written out.
|
|
84
|
+
|
|
85
|
+
## Learn more
|
|
86
|
+
|
|
87
|
+
[Technical details](https://github.com/Justdjent/jcarve/blob/main/docs/TECHNICAL.md) — every command and option, the browser interface,
|
|
88
|
+
restoring dates, how the reassembly works, performance, and how it compares with
|
|
89
|
+
published recovery methods.
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT — see [LICENSE](https://github.com/Justdjent/jcarve/blob/main/LICENSE).
|