Photoshop - Saving anything other than psd and psb files

I’m trying to find a way to save and publish out .png and .tiff’s from Photoshop but it doesnt want to take it (the list appears but it the defaults back to .psd when saving).

I managed to get .psb (Photoshop Large File Format) saving.

My Yaml:

photoshop_extension:
    type: str
    choices:
        psd: Photoshop PSD (.psd)
        psb: Photoshop Large File Format (.psb)
        jpeg: JPEG (.jpeg)
        tiff: TIFF (.tiff)
        png: PNG (.png)
    default: psd
    alias: extension

2 Likes

I can reproduce what you’re seeing, I’ll try and dig in tomorrow and understand why it’s doing this.

Thanks
Phil

3 Likes

Hi Ricardo

I’ve been looking into it, and it seems that our adobe.save_as(doc, file_path) will save it as either a psd or psb, but does not account for any other file types.

However I think you could modify the scene operations hook to check the file extension type and perform a different save option if it’s not psd or psb:

Here is an example of how to save a jpg:

And here is the Adobe reference docs as a guide:

It looks like you just need to get the correct options and then pass them to the save method, something like (not tested):

elif operation == "save_as":
    doc = self._get_active_document()
    if os.path.splitext(file_path)[-1] == ".png":
        png_options = adobe.PNGSaveOptions
        doc.saveAs(adobe.File(file_path), png_options )
    else:
        adobe.save_as(doc, file_path)
3 Likes