Skip to content

(API) lockWindowSize set to true can cut some content off #200

Description

@ModestasV

When trying to implement the API usage, I've seen lockWindowSize trying to cut off some content. Here's an example request:

{
            "settings": {
                "themeName": "github-dark",
                "title": "Hello from API!",
                "showHeader": 0,
                "showTitle": 0,
                "showMenu": 0,
                "borderRadius": 0,
                "lockWindowSize": 1
            },
            "editors": [
                {
                    "language": "php",
                    "value":"test123"
                }
            ]
        }

This produces the following image:

image

As you can see, the 3 is gone and nowhere to be found. This can be experienced with longer strings, too:

{
            "settings": {
                "themeName": "github-dark",
                "title": "Hello from API!",
                "showHeader": 0,
                "showTitle": 0,
                "showMenu": 0,
                "borderRadius": 0,
                "lockWindowSize": 1
            },
            "editors": [
                {
                    "language": "php",
                    "value": """
                     showcode_request = requests.post("https://api.showcode.app/generate", json=payload, headers=headers, stream=True)
        if showcode_request.status_code == 200:
            with open('_temp/code.png', 'wb') as temp_file:
                showcode_request.raw.decode_content = True
                shutil.copyfileobj(showcode_request.raw, temp_file)
        carbon_image = Image.open('_temp/code.png')
        # Place the code on the image
                    """
                }
            ]
        }

This produces an image that looks like this:

image

Which is again cut off at some point.

I have tried playing with the settings, but no luck figuring it out (without manually passing width/height).

Not sure if I'm doing something wrong or this is a bug :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions