summaryrefslogtreecommitdiff
path: root/cmd/rescribe/main.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2021-11-23 17:31:09 +0000
committerNick White <git@njw.name>2021-11-23 17:31:09 +0000
commitc40fb54b4b4d85060b8f60cb76fec5c7b23ca34b (patch)
treea19173acaa6777485f392b5069ef4d86036f3cbe /cmd/rescribe/main.go
parent3230f43a88729440ae7408b5b2914b186be95a84 (diff)
rescribe: Remove debugging printfs related to PDF parsing
Diffstat (limited to 'cmd/rescribe/main.go')
-rw-r--r--cmd/rescribe/main.go5
1 files changed, 0 insertions, 5 deletions
diff --git a/cmd/rescribe/main.go b/cmd/rescribe/main.go
index 0724c88..da38c96 100644
--- a/cmd/rescribe/main.go
+++ b/cmd/rescribe/main.go
@@ -306,17 +306,14 @@ func extractPdfImgs(path string) (string, error) {
for pgnum := 1; pgnum <= p.NumPage(); pgnum++ {
if p.Page(pgnum).V.IsNull() {
- fmt.Printf("Warning: page %d not found, skipping\n", pgnum)
continue
}
res := p.Page(pgnum).Resources()
if res.Kind() != pdf.Dict {
- fmt.Printf("Warning: no resources found on page %d, skipping\n", pgnum)
continue
}
xobj := res.Key("XObject")
if xobj.Kind() != pdf.Dict {
- fmt.Printf("Warning: no resources found on page %d, skipping\n", pgnum)
continue
}
// BUG: for some PDFs this includes images multiple times for each page
@@ -366,7 +363,6 @@ func rmIfNotImage(f string) error {
r.Close()
if err == nil {
b := strings.TrimSuffix(f, ".jpg")
- fmt.Printf("%s is PNG; renaming\n", f)
err = os.Rename(f, b + ".png")
if err != nil {
return fmt.Errorf("Error renaming %s to %s: %v", f, b + ".png", err)
@@ -382,7 +378,6 @@ func rmIfNotImage(f string) error {
_, err = jpeg.Decode(r)
if err != nil {
r.Close()
- fmt.Printf("%s is not PNG or JPEG; removing\n", f)
err = os.Remove(f)
if err != nil {
return fmt.Errorf("Failed to remove invalid image %s: %v", f, err)