Git Product home page Git Product logo

Comments (5)

Investigamer avatar Investigamer commented on May 28, 2024 1

This appears to be fixed, so I'm going to close this. Will reopen if another card ends up crashing in the future!

from proxyshop.

davidianstyle avatar davidianstyle commented on May 28, 2024

I ran into this issue with Firkraag, Cunning Instigator as well. Currently unable to test your most recent fix since I'm running into a ModuleNotFoundError: No module named 'get_image_size'

from proxyshop.

davidianstyle avatar davidianstyle commented on May 28, 2024

Ok, so after resolving my dependency issue by running pip install -r requirements.txt I was able to get Firkraag, Cunning Instigator to render (using Extended template)! However, I immediately ran into the hanging issue again during the text box resizing when trying to render Nalia de'Arnise (using Expedition template) during the "Formatting text..." stage.

Error was as follows:

File "D:\Users\davidianstyle\Code\MTG-Proxyshop\proxyshop\templates.py", line 241, in execute
     this_layer.execute()
   File "D:\Users\davidianstyle\Code\MTG-Proxyshop\proxyshop\text_layers.py", line 372, in execute
     super().execute()
   File "D:\Users\davidianstyle\Code\MTG-Proxyshop\proxyshop\text_layers.py", line 287, in execute
     ft.format_text(self.contents + "\r" + self.flavor_text, self.italic_text, self.flavor_index, self.centered)
   File "D:\Users\davidianstyle\Code\MTG-Proxyshop\proxyshop\format_text.py", line 495, in format_text
     app.executeAction(idsetd, desc119, NO_DIALOG)
   File "D:\Users\davidianstyle\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\photoshop\api\application.py", line 
355, in executeAction
     return self.app.executeAction(event_id, descriptor, display_dialogs)
   File "D:\Users\davidianstyle\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\comtypes\client\lazybind.py", line 182, in caller
     return self._comobj._invoke(descr.memid, descr.invkind, 0, *args)
   File "D:\Users\davidianstyle\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\comtypes\automation.py", line 745, in _invoke
     self.__com_Invoke(memid, riid_null, lcid, invkind,```

from proxyshop.

Investigamer avatar Investigamer commented on May 28, 2024

I keep forgetting to make commits but I finally designed a robust fix for the long text entry crash a couple days back, just pushed changes so pick them up and let me know if that does it for ya! I tested Nalia de'Arnise on Expedition template and working on my end.

Here's an outline of how the fix works:

  • if card has over 280 characters, insert the contents and the flavor text, then:
  • scale_text_to_fit_height() -- New function similar to scale to fit reference, feed it the height of the reference increased by 1%
  • everything else in the text_layers class runs as normal afterwards (insert text, format it, scale it, add divider, etc)

I realized the crash happens during format_text(), not when the text is initially inserted. It must have something to do with working with the text using action descriptors when the text doesn't fit the textbox. So, we do a pre-format resize of the text till its low enough to almost fit.

The reason I chose to use the height of the reference + 1% is because this scaling is being done before the text is formatted. The reason we scale after formatting is to account for any size loss caused by formatting the symbols and such. I wanted to leave just enough headroom to keep outside the bounds and the traditional scale_text_to_fit_reference() will make the last reduction if needed.

from proxyshop.

davidianstyle avatar davidianstyle commented on May 28, 2024

Awesome, that worked! Results uploaded to my drive.

from proxyshop.

Related Issues (20)

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.