Skip to content

Commit

Permalink
Cover Images Added (#11)
Browse files Browse the repository at this point in the history
* Cover Images Added

* 3x4 ratio cover images

* Rename Linux IP Networking_ A Guide to the Implementation and Modification of the Linux Protocol Stack.pdf to Linux_IP_Networking_ A_Guide_to_the_Implementation_and_Modification_of_the_Linux_Protocol_Stack.pdf

* Rename README to README.md
  • Loading branch information
deep5050 authored Mar 11, 2024
1 parent 9685669 commit 60321fe
Show file tree
Hide file tree
Showing 71 changed files with 92 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Algorithm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
![cover](./images/Introduction_to_Algorithms_[coremen]_(3).png)
![cover](./images/The_Art_of_Computer_Programming_[Donald_E._Knuth]_(3).png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Cryptography/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
![cover](./images/Cryptography_and_network_security_[stallings]_(5).png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Data communication and networking/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
![cover](./images/Computer_networking_a_top_down_aproach_[kurose,_ross]_(6).png)
![cover](./images/Data_and_computer_communications_[stallings]_(8).png)
![cover](./images/Data_communication_and_networking_[forouzan]_(4).png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Data science/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
![cover](./images/Data_mining_concepts_and_techniques_[Jiawei_Han,_Micheline_Kamber,_Jian_Pei]_(3).png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Data structure/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
![cover](./images/Data_structures_algorithm_analysis_in_c++_[mark_allen_weiss]_(4).png)
![cover](./images/Data_structures_and_program_design_in_c++_[kruse,_ryba]_(1)_.png)
![cover](./images/Data_structures_using_c_[reema_thareja]_(2).png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Database/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
![cover](./images/Database_Management_Systems_[Ramakrishnan]_(3).png)
![cover](./images/Fundamentals_of_Database_Systems_[Elmasri,_Navathe]_(7).png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Digital electronics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
![cover](./images/Digital_design_[Morris_Mano]_(5).png)
![cover](./images/Digital_electronics_[anil.k.maini]_(1).png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Electronics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
![cover](./images/Principles_of_electronics_[V.K_Mehta]_(1).png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions General concepts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
![cover](./images/Computer_science_distilled_[Wladston_Ferreira_Filho]_(1).png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Graph theory/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
![cover](./images/Graph_theory_with_applications_[C._Vasudev]_(1).png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Microprocessor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
![cover](./images/8085_microprocessors_through_question_answers_[S.K.Sen]_(2).png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions OOP/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
![cover](./images/Object_oriented_programming_in_c++_[Robert_Lafore]_(4).png)
![cover](./images/Oop_with_c++_solution_[E_balagurusamy].png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Operating system/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
![cover](./images/Operating_system_A_concept-based_approach_[Dhamdhere]_(1).png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Parallel computing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
![cover](./images/Distributed_computing_[singhal].png)
![cover](./images/Distributed_systems_principles_and_paradigms_[tanenbaum]_(2).png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Software engineering/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
![cover](./images/Object_oriented_software_engineering_[mc_graw_hill].png)
![cover](./images/Software_engineering_IIT_khargapur_[rajib_mall].png)
![cover](./images/Software_engineering_[sommerville].png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Theory of computer science/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
![cover](./images/Introduction_to_automata_theory_[hopcroft,_ullman]_(2).png)
![cover](./images/Theory_of_automata,_formal_languages_and_computation_[new_age_publishers].png)
![cover](./images/Theory_of_computer_science_[klp_mishara]_(3).png)
10 changes: 10 additions & 0 deletions Unix/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
![cover](./images/Linux_IP_Networking__A_Guide_to_the_Implementation_and_Modification_of_the_Linux_Protocol_Stack.png)
![cover](./images/Linux_Kernel_Crash_Book.png)
![cover](./images/Linux_System_Programming_-_Robert_Love.png)
![cover](./images/Linux_commands_Notes_for_Professionals.png)
![cover](./images/Managing_Projects_with_GNU_Make.png)
![cover](./images/The_Linux_programming_interface_a_Linux_and_UNIX_system_programming_handbook_(Michael_Kerrisk)_(z-lib.org).png)
![cover](./images/UNIX_and_shell_programming_[oxford_university_press].png)
![cover](./images/Understanding_Linux_Network_Internals.png)
![cover](./images/linux_network_administrators_guide_3rd_edition.png)
![cover](./images/opdenacker-embedded-linux-size-reduction-techniques.png)
Binary file added Unix/images/Linux Kernel Crash Book.png
Binary file added Unix/images/Linux_Kernel_Crash_Book.png
Binary file added Unix/images/Managing Projects with GNU Make.png
4 changes: 4 additions & 0 deletions Wireless sensor networking/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
![cover](./images/Fundamentals_of_wireless_sensor_networks_[Waltenegus_Dargie].png)
![cover](./images/Protocols_and_architectures_for_wireless_sensor_networks_[karl,_willing].png)
![cover](./images/Wireless_sensor_network_designs_[anna_Hac].png)
![cover](./images/Wireless_sensors_network_[Kazem_Sohraby,_Daniel_Minoli,_Taieb_Znati].png)
49 changes: 49 additions & 0 deletions extract_cover_images.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# pip install pymupdf Pillow

import os
import fitz # PyMuPDF
from PIL import Image
from io import BytesIO
import sys

def extract_cover_pages(pdf_directory, output_directory):
# Ensure the output directory exists
if not os.path.exists(output_directory):
os.makedirs(output_directory)

# Iterate through all PDF files in the input directory
for filename in os.listdir(pdf_directory):
if filename.endswith(".pdf"):
pdf_path = os.path.join(pdf_directory, filename)
output_image_path = os.path.join(output_directory, f"{os.path.splitext(filename)[0].replace(" ","_")}.png")
# Open the PDF file
pdf_document = fitz.open(pdf_path)

# Extract the first page as a pixmap
first_page = pdf_document[0].get_pixmap()

# Save the pixmap as a PNG file
first_page._writeIMG(output_image_path,"jpg","90")
try:
# Open the image
with Image.open(output_image_path) as img:
# Resize the image to a 4:3 aspect ratio
resized_img = img.resize((300, 400))
# resized_img = img.resize((int(img.width * 4/3), img.height))

# Save the resized image, overwriting the original file
resized_img.save(output_image_path)

except Exception as e:
print(f"Error processing '{filename}': {e}")

# Close the PDF file
pdf_document.close()
print(f"![cover](./images/{os.path.basename(output_image_path)})")

if __name__ == "__main__":
# Replace 'input_directory' and 'output_directory' with your actual paths
input_directory = sys.argv[1]
output_directory = os.path.join(input_directory,"images")

extract_cover_pages(input_directory, output_directory)

0 comments on commit 60321fe

Please sign in to comment.