I've got a bunch of CBZ files, how do I check which ones have PNG files? Not in the file name extension...

I've got a bunch of CBZ files, how do I check which ones have PNG files? Not in the file name extension, but the image itself being PNG. I have over a million CBZ which is PNG but the filenames have JPG. I want something that reports back to me which CBZ files have PNG images.

Attached: 1521813408955.png (707x1000, 594K)

that artist is really good at drawing tummies

just unzip them

the easy option is to write a script that unzips them then run 'file' over them to figure out that they are
you can leave it running over a couple of day, or something

Miho is clearly gay for her sister, delete this

Attached: 57760932_p13.jpg (2048x1314, 1.12M)

Miho is everyone's fucktoy.

Can't unzip it, I don't have the space to do it.

Use zipinfo
zipinfo -1 *.cbz | grep -i -F '.png'

I told you dude. There are PNG images that says "test.jpg" so I can't use "grep .png"

Your script will have to do things one-by-one then.
>unzip one file
>test resultant file
>record result somewhere
>delete working files

1. Mark all your .cbz as read-only.
2. Have your script operate in a temporary directory, so it can't delete anything important by accident.

The alternative to this easy option is to write yourself a program.
You'll probably have to study the .cbz file format at a minimum.

Use file

The .cbz format is just a ZIP file with numbered entries. There's probably a way to do it with `file -` and `unzip -p`, but it's probably gonna be painful.

Actually, PNG's are easily identified by their header. It contains 0x89 and then the ASCII string "PNG". So one only needs to decompress the first four bytes of each file to determine its type.

Not used python in years,
but does it have a module that allows you access the content of zip files via file handles?

Rename cbz extension to zip, then explore with your favorite archive manager. I would use als from atools so I can grep them.

Python does have a zipfile module, but I'm thinking Perl for this one:
#!/usr/bin/perl -w
foreach my $fl (@ARGV) {
open(my $fh, '-|', "zipinfo -1 $fl");
while () {
my $pid = open(my $fz, '-|', "unzip -p $fl $_");
read($fz, my $hd, 4);
print "$fl $_\n" if $hd =~ /PNG/;
close $fz;
kill 'TERM', $pid;
waitpid $pid;
}
}

Bodies are so good that the faces look amateurish by comparison, he should just stop drawing faces desu

bump

>unzip to flash drive that's lying around
>make 512mb ram disk, unzip there
>buy a bigger fucking hard drive

Attached: 1521011297465.jpg (715x655, 45K)

Yeah I'm going to buy a 12TB drive to unzip a bunch pf.files for no reason

Go fuck yourself you autistic retard

12TB? You don't need something of that size...

how fucktarded are you?
What's the size distribution of your CBZs (zipped and unzipped), and how much free space do you have?

dumb phoneposter