Highlighted

Image Processor.jsx for PNG

Adobe Community Professional ,
Jul 30, 2020

Copy link to clipboard

Copied

I opened and edited Image Processor.jsx. Everywhere it said TIFF, I edited to say PNG. 

And it almost worked. It shows up on screen. Alas the save part fails. Too bad I'm such a noob on javascripting! 

 

But it reminds me that it can be done. 

And it reminds me that PNG should be in Image Processor.jsx; not TIFF. Web wants PNG!

 

Would anyone help me to troubleshoot my file? 

I'm certain this portion is wrong:

function SaveAsPNG( inFileName, inEmbedICC ) {
	var sfw = new ExportOptionsSaveForWeb();
    	sfw.format = SaveDocumentType.PNG;
	sfw.PNG8 = false; // use PNG-24
	sfw.transparency = true;    
	doc.info = null; // delete metadata
	}
Mike Witherell
TOPICS
Actions and scripting

Views

71

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Image Processor.jsx for PNG

Adobe Community Professional ,
Jul 30, 2020

Copy link to clipboard

Copied

I opened and edited Image Processor.jsx. Everywhere it said TIFF, I edited to say PNG. 

And it almost worked. It shows up on screen. Alas the save part fails. Too bad I'm such a noob on javascripting! 

 

But it reminds me that it can be done. 

And it reminds me that PNG should be in Image Processor.jsx; not TIFF. Web wants PNG!

 

Would anyone help me to troubleshoot my file? 

I'm certain this portion is wrong:

function SaveAsPNG( inFileName, inEmbedICC ) {
	var sfw = new ExportOptionsSaveForWeb();
    	sfw.format = SaveDocumentType.PNG;
	sfw.PNG8 = false; // use PNG-24
	sfw.transparency = true;    
	doc.info = null; // delete metadata
	}
Mike Witherell
TOPICS
Actions and scripting

Views

72

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 30, 2020 0
Adobe Community Professional ,
Jul 30, 2020

Copy link to clipboard

Copied

I can supply the whole Image Processor.jsx upon request, if the above is not enough.

Mike Witherell

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 30, 2020 0
Adobe Community Professional ,
Jul 30, 2020

Copy link to clipboard

Copied

Mike, I think that this would be better placed in either the Photoshop or Bridge forums.

 

Although it is probably "easy enough" to hack the default Adobe Image Processor script, I would suggest that you spend your time installing the better Image Processor Pro script from xbytor:

 

https://sourceforge.net/projects/ps-scripts/files/Image%20Processor%20Pro/v3_2%20betas/

 

Or perhaps the Picture Processor script from Paul Riggott:

 

https://raw.githubusercontent.com/Paul-Riggott/PS-Scripts/master/Picture%20Processor.jsx

 

_________

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 30, 2020 0
Adobe Community Professional ,
Jul 30, 2020

Copy link to clipboard

Copied

Thanks Stephen! I thought I would move it over to a forum where smart people would appreciate where I'm going with this! It has always seemed to me that Image Processor.jsx should take out the TIFF section and add in a PNG section. I just need to add the parts where you select specific attributes for PNG files, and that is where my inexperience stops me.

Mike Witherell

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 30, 2020 0
Adobe Community Professional ,
Jul 31, 2020

Copy link to clipboard

Copied

OK, however, my point was that PNG is a native feature of both of the more capable scripts posted above.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 31, 2020 0
Adobe Community Professional ,
Jul 31, 2020

Copy link to clipboard

Copied

Yes, you are right. I like the simplicity of the built-in version Image Processor.jsx. I hadn't seen the Image Processor PRO.jsx updated in the last 5 years, and the last time I tried to use it, it wouldn't work on my MacBook Pro, but I will try it again. It seems to work fine on my Win10 box.

Mike Witherell

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 31, 2020 0