Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix: jpg images not getting converted by image-resizer

Brad Barbincb1f5e554743
diff --git a/apps/erp/app/modules/sales/ui/Quotes/QuoteExplorer.tsx b/apps/erp/app/modules/sales/ui/Quotes/QuoteExplorer.tsx
index 0fca338e10..48992dfc23 100644
--- a/apps/erp/app/modules/sales/ui/Quotes/QuoteExplorer.tsx
+++ b/apps/erp/app/modules/sales/ui/Quotes/QuoteExplorer.tsx
@@ -320,10 +320,12 @@ function QuoteLineItem({
View Item Master
</Link>
</DropdownMenuItem>
- <DropdownMenuItem onClick={searchDisclosure.onOpen}>
- <DropdownMenuIcon icon={<LuSearch />} />
- Search
- </DropdownMenuItem>
+ {line.methodType === "Make" && (
+ <DropdownMenuItem onClick={searchDisclosure.onOpen}>
+ <DropdownMenuIcon icon={<LuSearch />} />
+ Search
+ </DropdownMenuItem>
+ )}
</DropdownMenuContent>
</DropdownMenu>
</HStack>
diff --git a/packages/database/supabase/functions/image-resizer/index.ts b/packages/database/supabase/functions/image-resizer/index.ts
index c62ac18833..fdf57dda40 100644
--- a/packages/database/supabase/functions/image-resizer/index.ts
+++ b/packages/database/supabase/functions/image-resizer/index.ts
@@ -43,6 +43,7 @@ serve(async (req: Request) => {
const result = ImageMagick.read(bytes, (img) => {
// First convert to PNG to ensure consistent handling
img.format = MagickFormat.Png;
+ img.write((data) => data); // Write to PNG first
const width = img.width;
const height = img.height;
@@ -77,6 +78,7 @@ serve(async (req: Request) => {
sizeWithPadding
);
containedGeometry.ignoreAspectRatio = true;
+
img.extent(
containedGeometry,
Gravity.Center,