Filesize #37
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
By Francisco on 2017-10-19T00:09:00.806Z
I am trying to write a tool to get images from a Wikimedia Commons category and create a pdf from them. We are probably going to have a lot of these categories as we are uploading images from an archive that digitized them in jpeg format.
It is very important to keep the quality of the original images, so I discarded a few approaches that would reencode the images before the conversion.
Now, this approach works, but it gives me a huge file size. For the first pdf I have 39 files that amount to a total of 21.5mb. My converted pdf came to 901.6mb. Is this expected?
The code I am using is this:
You can check the files and the code in context if necessary.
By josch on 2017-10-19T04:27:22.254Z
Your code doesn't look right. You are going through the
pages_list
variable and convert all of them every time. So if yourpages_list
variable contains these 39 entries of overall 21.5 MiB, then you are writing 21.5 MiB 39 times for a total of 838.5 MiB which in turn explains the 901.6 MiB that you see. Instead you probably want:or
By Francisco on 2017-10-19T10:50:32.394Z
I feel silly now. Thank you.
By Francisco on 2017-10-19T10:50:32.731Z
Status changed to closed