Skip to content

Conversation

@Qualigraphe
Copy link

Description

DPI Converter is a utility extension that converts between pixels, centimeters, millimeters, and inches with customizable DPI support.

Features:

  • Convert single or dual dimensions (width × height)
  • Support for pixels (px), centimeters (cm), millimeters (mm), inches (in)
  • Customizable DPI resolution (default: 300 DPI)
  • Detailed step-by-step calculations
  • Quick copy actions with keyboard shortcuts

Use Cases:
Perfect for designers, publications editors and printing houses who need to convert units for print design (A4, US Letter…). This extension allows them, for example, to know how many pixels are the minimum required to print at a good resolution.

Screencast

Screenshots are included in the metadata/ folder showing:

  1. The conversion form with input fields
  2. The detailed calculation results with all unit conversions

Checklist

  • I read the extension guidelines
  • I read the documentation about publishing
  • I ran npm run build and tested this distribution build in Raycast
  • I checked that files in the assets folder are used by the extension itself
  • I checked that assets used in the README are located outside the metadata folder if they were not generated with our metadata

@raycastbot
Copy link
Collaborator

Congratulations on your new Raycast extension! 🚀

Due to our current reduced availability, the initial review may take up to 10-15 business days.

Once the PR is approved and merged, the extension will be available on our Store.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 10, 2026

Greptile Overview

Greptile Summary

This PR adds a new DPI Converter extension that converts between pixels, centimeters, millimeters, and inches with customizable DPI support. The extension provides both single and dual dimension conversion capabilities with detailed step-by-step calculations.

Key Features:

  • Form-based interface for entering dimensions with unit specifications
  • Support for px, cm, mm, and in units
  • Customizable DPI resolution with default of 300
  • Detailed calculation display in results view
  • Copy actions with keyboard shortcuts

Implementation Quality:
The extension follows Raycast patterns well with proper use of Form and Detail components. The conversion math is correct, and the code structure is clean. However, there are a few issues that should be addressed:

  1. Critical: DPI validation doesn't prevent negative values, which could cause incorrect calculations
  2. The package.json includes an unused dependency (@raycast/utils)
  3. Minor grammatical errors in descriptions

The extension includes proper metadata screenshots and follows the standard extension structure. Overall, this is a useful utility extension with solid functionality that just needs minor fixes to the validation logic.

Confidence Score: 4/5

  • This PR is mostly safe to merge with one logical issue to address
  • Score of 4 reflects that the extension is well-structured and follows Raycast patterns correctly, with accurate conversion math. The main concern is the DPI validation issue that allows negative values, which is a logic bug but won't cause crashes. The unused dependency and grammatical errors are minor style issues. After fixing the DPI validation, this would be a solid 5.
  • Pay close attention to convert-to-px-cm-mm-in.tsx line 54 for the DPI validation fix

Important Files Changed

File Analysis

Filename Score Overview
extensions/dpi-converter/src/convert-to-px-cm-mm-in.tsx 3/5 Main converter logic with DPI validation issue allowing negative values
extensions/dpi-converter/package.json 4/5 Configuration has unused dependency and minor grammatical errors in descriptions

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

}

async function handleSubmit(values: { dimension1: string; dimension2?: string; dpi: string }) {
const dpiValue = parseInt(values.dpi) || 300;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DPI validation here doesn't handle negative numbers. When parseInt(values.dpi) returns a negative number like -10, the || 300 fallback won't trigger because -10 is truthy. This will cause incorrect calculations with negative DPI values.

Consider adding proper validation:

Suggested change
const dpiValue = parseInt(values.dpi) || 300;
const dpiValue = Math.max(1, parseInt(values.dpi) || 300);

This ensures DPI is always at least 1, preventing division by negative numbers or very small values that could cause precision issues.

],
"dependencies": {
"@raycast/api": "^1.104.1",
"@raycast/utils": "^1.17.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raycast/utils is listed as a dependency but is never imported or used anywhere in the extension code. This adds unnecessary weight to the bundle.

Suggested change
"@raycast/utils": "^1.17.0"
"dependencies": {
"@raycast/api": "^1.104.1"
},

Remove this unused dependency to reduce bundle size.

"$schema": "https://www.raycast.com/schemas/extension.json",
"name": "dpi-converter",
"title": "DPI Converter",
"description": "Convert pixels in centimeters, millimeter and inches, and vice-versa! Useful for printers.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description has grammatical errors: "Convert pixels in centimeters, millimeter and inches" should use "to" instead of "in", "millimeters" should be plural, and there should be a comma before "and".

Suggested change
"description": "Convert pixels in centimeters, millimeter and inches, and vice-versa! Useful for printers.",
"description": "Convert pixels to centimeters, millimeters, and inches, and vice-versa! Useful for printers.",

{
"name": "convert-to-px-cm-mm-in",
"title": "Convert to px, cm, mm, in",
"description": "Convert px in cm, mm, in, and vice-versa.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same grammatical issue as the main description: "Convert px in cm" should be "Convert px to cm".

Suggested change
"description": "Convert px in cm, mm, in, and vice-versa.",
"description": "Convert px to cm, mm, in, and vice-versa.",

Copy link
Contributor

@0xdhrv 0xdhrv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @Qualigraphe 🔥

We already have core calculator which deals with this.

If there are unique features or workflows you’re aiming to add, we’d love to hear them as feedback and see if they can be integrated into one of these to avoid duplication and improve discoverability.

This would help avoid duplication and keep related functionality consolidated in one place.
As mentioned in our extension guidelines here ↗

@0xdhrv 0xdhrv marked this pull request as draft January 12, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants