Code Monkey home page Code Monkey logo

medium-articles-notebooks's People

Contributors

keitazoumana avatar

Stargazers

Russell Peiris avatar Minh avatar Muhammad Shah avatar Anna avatar Suri avatar Ashik avatar Devendra Punia avatar kaijie-qin avatar ROVAST avatar  avatar Eddy Giusepe Chirinos Isidro, PhD avatar codewalker7 avatar Tarkus avatar r_1208 avatar Leonardo Nels avatar Daniel Tejada H. avatar Hérco ZauZau avatar  avatar tfan avatar Panayiotis Tzagkarakis avatar yunhao zhang avatar  avatar  avatar  avatar Minggang Dou avatar Damodhar avatar DSamuelHodge avatar Edin Redjovikj avatar Praveen avatar Shams Basir avatar Rashmi Shree Veeraiah avatar Poorna avatar  avatar Lucas Saccone avatar  avatar CoderPanda avatar  avatar  avatar Avinash avatar Rana Banerjee avatar  avatar  avatar Lin avatar Mahesh Budavarapu avatar  avatar Irusha avatar SamgeShao avatar Ryan avatar yudejing avatar Jorge Gomes avatar 崔驰坤 Cui, Richard Chikun avatar  avatar Aaron Hung avatar  avatar Kevin Smith avatar ZeroXClem avatar  avatar Jhon Lopez avatar Pratham Choudhary avatar Anton A  avatar Daniel (Donghyun) Kang avatar KawaCao avatar  avatar ww166 avatar  avatar  avatar Dinesh Kumar Amara avatar Yuan JIN avatar  avatar Theo Masunga avatar Jiackylee avatar  avatar paramtapm.ai avatar Yi avatar Matthias Frank avatar Arturo Mejia avatar Gordon Wright avatar ASHISH JOHNSON avatar  avatar Herman Ho avatar Dibyendu Chatterjee avatar  avatar  avatar Nermen Salama avatar  avatar Vincent avatar Taner yılmaz avatar  avatar Marcel Mello avatar Paramanantham Harrison avatar Izzy Al-Zyoud avatar Hariharan avatar  avatar  avatar Durgesh Samariya avatar Kishor Kukreja avatar William Mbotta avatar Paul Tsung avatar Bikash singh avatar SangAh Lee (Ivory) avatar

Watchers

James Cloos avatar Anirvan BASU avatar Yi avatar  avatar

medium-articles-notebooks's Issues

A process in the process pool was terminated abruptly while the future was running or pending.

Error: concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.

Expected Result: All images of the PDF to be outputted as images

What is happening: Whenever I run the code

`def convert_pdf_to_images(file_path, scale=300/72):

pdf_file = pdfium.PdfDocument(file_path)

page_indices = [i for i in range(len(pdf_file))]

renderer = pdf_file.render(
    pdfium.PdfBitmap.to_pil,
    page_indices = page_indices, 
    scale = scale,
)

final_images = [] 

for i, image in zip(page_indices, renderer):
    
    image_byte_array = BytesIO()
    image.save(image_byte_array, format='jpeg', optimize=True)
    image_byte_array = image_byte_array.getvalue()
    final_images.append(dict({i:image_byte_array}))

return final_images`

The code will not run and is giving this error.

` An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.