Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

widthAdjustment: true do not exceed 1024px #207

Open
am29d opened this issue Mar 21, 2024 · 0 comments
Open

widthAdjustment: true do not exceed 1024px #207

am29d opened this issue Mar 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@am29d
Copy link

am29d commented Mar 21, 2024

Describe the bug
When I try to generate image with a long code line, the output image is fixed to 1024p for 1x and 2048p for 2x output size.

To Reproduce
Steps to reproduce the behavior:

  1. Run carbon-now with…
  2. Wait for image to download…
  3. See error
  4. Paste code to carbon.now.sh using adjustWidth true
  5. The image is in full width without line breaks

** Code I am using **

import { BatchProcessor, EventType, processPartialResponse, } from '@aws-lambda-powertools/batch';
import type { SQSEvent, SQSRecord, Context, SQSBatchResponse } from 'aws-lambda';

const processor = new BatchProcessor(EventType.SQS);

const recordHandler = async (record: SQSRecord): Promise<void> => {
  const payload = record.body;
};

export const handler = async (
  event: SQSEvent,
  context: Context
): Promise<SQSBatchResponse> => {
  return processPartialResponse(event, recordHandler, processor, {context});
};

Configuration json file for the cli

{
    "latest-preset": {
        "theme": "night-owl",
        "backgroundColor": "#161E2D",
        "dropShadows": false,
        "exportSize": "1x",
        "firstLineNumber": 1,
        "fontFamily": "Hack",
        "fontSize": "18px",
        "language": "auto",
        "lineHeight": "133%",
        "lineNumbers": true,
        "selectedLines": "*",
        "squaredImage": false,
        "type": "png",
        "watermark": false,
        "widthAdjustment": true,
        "windowControls": false,
        "windowTheme": "none"
    }
}

Expected behavior
I expect the tool to not break the line and take as much with as necessary

Screenshots
Carbon website manually :
Screenshot 2024-03-21 at 12 37 54

Output using cli
batch-cmwtfGg40t

Carbon website using --open-in-browser flag:

Screenshot 2024-03-21 at 12 42 32

Edit: I tried to reduce the fontSize to 14 or 12, but the results are still ab bit weird, but the width seems to be correct:

batch-X2QN56ETIo

Info (please complete the following information):

Code snippet
  
  
@am29d am29d added the bug Something isn't working label Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant