Color profile error in createImageDataFromBuffer

I getPixels() from a grayscale image, modify them then put them back. So far I have been passing the colorProfile I got from the original imageData back to createImageDataFromBuffer

I just tried this on an image with a “Grayscale D50” profile and I get an error “Photoshop Error. Code: -26120. Message: Unknown color profile”

Looking at the color profiles that app.getColorProfiles(“Gray”) returns, Grayscale D50 is not one of them. I know it is optional to pass a profile to createImageDataFromBuffer. If I don’t does it assume my data needs no conversion or is it assuming a default profile and converting it?

Do you have the code block where this issue happens? Looking at that would be helpful.

Sure thing, it is pretty straightforward.

const srcPixels = await getPixels({ documentId: doc.id });
const srcBuff = await srcPixels.imageData.getData();
const { width, height, colorProfile } = srcPixels.imageData;

const imageData = await createImageDataFromBuffer(srcBuff, { width: width, height: height, components: 1, colorSpace: "Grayscale", colorProfile: colorProfile });

Works fine if the colorProfile is one of these, but in this case the image is “Greyscale D50”

0: "Dot Gain 10%"
1: "Dot Gain 15%"
2: "Dot Gain 20%"
3: "Dot Gain 25%"
4: "Dot Gain 30%"
5: "Gray Gamma 1.8"
6: "Gray Gamma 2.2"
7: "EPSON  Gray - Gamma 1.8"
8: "EPSON  Gray - Gamma 2.2"
9: "Generic Gray Gamma 2.2 Profile"
10: "Generic Gray Profile"
11: "sGray"