Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract: images using Predictor and BitsPerComponent != 8 #387

Closed
ogimenezb opened this issue Oct 15, 2021 · 5 comments
Closed

extract: images using Predictor and BitsPerComponent != 8 #387

ogimenezb opened this issue Oct 15, 2021 · 5 comments
Assignees
Labels

Comments

@ogimenezb
Copy link

I'm trying to extract the QR image from the Covid PDF and I have an error.

Fatal: pdfcpu: filter FlateDecode: "BitsPerComponent" must be 8

Attaching crash log.
crash.log

@hhrutter hhrutter self-assigned this Oct 15, 2021
@hhrutter
Copy link
Collaborator

hhrutter commented Oct 16, 2021

duplicate of #380

Thanks for reporting this!

@hhrutter hhrutter added bug and removed investigate labels Oct 16, 2021
@hhrutter
Copy link
Collaborator

hhrutter commented Oct 16, 2021

Image decoding for images using a Predictor and bitsPerPixel != 8 is untested and therefore disabled.
If anybody out there can share a sample file with such an image I am happy to implement this.

What I would need in order to reproduce and fix the error reported originally on the top is an image object using a Predictor.
This does not show up in the output of pdfcpu images list but you can first use this command to identify the object number and then check the concrete image dict in the output of pdfcpu val -v test.pdf.

<<
	<BitsPerComponent, 4>
	<ColorSpace, [Indexed [CalRGB
			<<
				<Gamma, [2.20 2.20 2.20]>
				<Matrix, [0.41 0.21 0.02 0.36 0.72 0.12 0.18 0.07 0.95]>
				<WhitePoint, [0.95 1 1.09]>
			>>
			] 6 (üÝ\tél�Ú��Þ'�åU�á?�ÿÿÿ)]>
	<DecodeParms, <<
		<BitsPerComponent, 4>
		<Colors, 1>
		<Columns, 640>
		<Predictor, 15>
	>>>
	<Filter, FlateDecode>
	<Height, 427>
	<Length, 389>
	<Subtype, Image>
	<Type, XObject>
	<Width, 640>
>>

@hhrutter hhrutter changed the title "BitsPerComponent" must be 8 extract: images using Predictor~ and BitsPerComponent` != 8 Oct 16, 2021
@hhrutter hhrutter changed the title extract: images using Predictor~ and BitsPerComponent` != 8 extract: images using Predictor and BitsPerComponent != 8 Oct 16, 2021
@petervwyatt
Copy link

petervwyatt commented Oct 17, 2021

<</Type /XObject /Subtype /Image /Width 172 /Height 119 /ColorSpace [/Indexed /DeviceRGB 15 30 0 R] /BitsPerComponent 4 /Filter /FlateDecode /DecodeParms << /Predictor 15 /Colors 1 /BitsPerComponent 4 /Columns 172 >> /Length 2333 >>

Predictor15-BPC4.pdf

hhrutter added a commit that referenced this issue Oct 17, 2021
@hhrutter
Copy link
Collaborator

This is fixed with the latest commit!
Thanks everybody for their input 👍

@ogimenezb
Copy link
Author

Working perfectly.
Awesome, thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants