[{"data":1,"prerenderedAt":619,"buildId":620},["ShallowReactive",2],{"\u002Fautomations\u002Fguides\u002Fcompress-uploads":3,"\u002Fautomations\u002Fguides\u002Fcompress-uploads-surround":535,"navigation":548},{"id":4,"title":5,"body":6,"description":526,"extension":527,"meta":528,"navigation":529,"path":531,"seo":532,"stem":533,"__hash__":534},"docs\u002F2.automations\u002F10.guides\u002F1.compress-uploads.md","Compress and resize uploads",{"type":7,"value":8,"toc":512},"minimark",[9,13,16,27,41,339,343,353,359,397,400,414,420,435,439,460,491],[10,11,12],"p",{},"This guide builds the most common intake workflow: every image you upload (from ShareX or the browser) has its metadata removed, is scaled down to fit 2560 × 2560, and is compressed before it's saved. Other files are saved as they are.",[10,14,15],{},"The finished workflow looks like this:",[17,18,24],"pre",{"className":19,"code":21,"language":22,"meta":23},[20],"language-text","File received → Strip metadata → Resize → Compress image → Save file (as the upload)\n","text","",[25,26,21],"code",{"__ignoreMap":23},[10,28,29,30,34,35,40],{},"Each content step reads the content from the step before it, and Save file reads the ",[31,32,33],"strong",{},"last"," one. Getting that chain right is the one thing to watch; ",[36,37,39],"a",{"href":38},"#check-what-save-file-reads","the last section"," explains why.",[42,43,45,50,70,93,97,111,126,130,143,152,156,163,192,199,203,215,226,229,239,243,255,295,299,305,309,318],"steps",{"level":44},"2",[46,47,49],"h2",{"id":48},"create-the-workflow","Create the workflow",[10,51,52,53,56,57,60,61,65,66,69],{},"Open ",[31,54,55],{},"Automations",", click ",[31,58,59],{},"New workflow",", name it ",[62,63,64],"em",{},"Shrink images",", and choose ",[31,67,68],{},"Upload intake"," as the kind.",[10,71,72,73,76,77,80,81,84,85,88,89,92],{},"The editor opens with ",[31,74,75],{},"File received"," connected to ",[31,78,79],{},"Save file",". Save file already reads the upload (",[31,82,83],{},"Content"," is ",[62,86,87],{},"File received › Content",") and has ",[31,90,91],{},"Save as the upload"," turned on.",[46,94,96],{"id":95},"limit-it-to-images","Limit it to images",[10,98,99,100,102,103,106,107,110],{},"Select ",[31,101,75],{}," and set ",[31,104,105],{},"File types"," to ",[25,108,109],{},"image\u002F*",".",[10,112,113,114,117,118,121,122,125],{},"Which other files go through this workflow depends on how you assign it. With ",[31,115,116],{},"Automatic"," intake, non-image uploads don't match and are saved as they are. With the workflow assigned to a token as ",[31,119,120],{},"A specific workflow",", non-image uploads with that token are ",[31,123,124],{},"refused",". If you upload other files with the same token, use Automatic.",[46,127,129],{"id":128},"strip-metadata","Strip metadata",[10,131,132,133,136,137,139,140,142],{},"Hover the connection between File received and Save file and click the ",[31,134,135],{},"+"," in its middle. Choose ",[31,138,129],{}," from the ",[31,141,83],{}," group.",[10,144,145,146,148,149,151],{},"Strip metadata gets ",[31,147,83],{}," = ",[62,150,87],{}," as a suggestion, and Save file now reads Strip metadata's content. The image is turned upright from its EXIF orientation, then saved without EXIF, location or other metadata.",[46,153,155],{"id":154},"resize","Resize",[10,157,158,159,65,161,110],{},"Hover the connection between Strip metadata and Save file, click ",[31,160,135],{},[31,162,155],{},[164,165,166,176,185],"ul",{},[167,168,169,171,172,175],"li",{},[31,170,83],{},": suggested as ",[62,173,174],{},"Strip metadata › Content",". Keep it.",[167,177,178,181,182],{},[31,179,180],{},"Max width",": ",[25,183,184],{},"2560",[167,186,187,181,190],{},[31,188,189],{},"Max height",[25,191,184],{},[10,193,194,195,198],{},"Resize keeps the proportions and only scales images down. Smaller images pass through unchanged unless you turn on ",[31,196,197],{},"Enlarge smaller images"," under Advanced.",[46,200,202],{"id":201},"compress","Compress",[10,204,205,206,209,210,84,212,110],{},"Insert ",[31,207,208],{},"Compress image"," between Resize and Save file the same way. Its ",[31,211,83],{},[62,213,214],{},"Resize › Content",[164,216,217],{},[167,218,219,181,222,225],{},[31,220,221],{},"Quality",[25,223,224],{},"80"," (the default) is a good start. It applies to JPEG and WebP; PNG is compressed without loss.",[10,227,228],{},"Compress keeps the image's format. If compressing doesn't make the file smaller, it keeps the input as it was, so this step never makes things worse.",[230,231,232],"tip",{},[10,233,234,235,238],{},"To change the format too, use ",[31,236,237],{},"Convert image"," instead of (or before) Compress image. It saves PNG, JPEG or WebP (WebP by default) with a quality you choose.",[46,240,242],{"id":241},"check-save-file","Check Save file",[10,244,99,245,247,248,250,251,254],{},[31,246,79],{}," and confirm ",[31,249,83],{}," reads ",[62,252,253],{},"Compress image › Content",". While you're there, you can set:",[164,256,257,275,281,289],{},[167,258,259,262,263,266,267,270,271,274],{},[31,260,261],{},"Folder"," and ",[31,264,265],{},"Subfolders",", for example ",[62,268,269],{},"Screenshots"," with subfolders ",[25,272,273],{},"{{ trigger.content.receivedAt | date: 'yyyy\u002FMM' }}",". Leave Folder empty to keep the folder the upload was sent to.",[167,276,277,280],{},[31,278,279],{},"Name",", to rename the file. Empty keeps the content's name. Converting changes the extension to match.",[167,282,283,262,286,110],{},[31,284,285],{},"Tags",[31,287,288],{},"Tag names",[167,290,291,294],{},[31,292,293],{},"Create a share link",", if the upload didn't already ask for one.",[46,296,298],{"id":297},"test","Test",[10,300,301,302,304],{},"Click ",[31,303,298],{}," and choose an image from your library. It stands in for an upload. Select each step to see what it produced: Resize shows the new width and height, Compress image the new size. Nothing is saved to your library during the test.",[46,306,308],{"id":307},"publish-turn-it-on-and-assign-it","Publish, turn it on, and assign it",[10,310,301,311,314,315,110],{},[31,312,313],{},"Publish",", then turn on ",[31,316,317],{},"Active",[10,319,320,321,323,324,56,327,330,331,334,335,338],{},"Then decide which uploads use it. Uploads from the browser and from tokens set to ",[31,322,116],{}," pick it up straight away, because it's an enabled intake workflow whose trigger accepts images. To be sure your ShareX token always uses it, open ",[31,325,326],{},"Settings › API tokens",[31,328,329],{},"Intake"," on that token, and choose ",[31,332,333],{},"A specific workflow › Shrink images",". Consider setting ",[31,336,337],{},"Wait for processing"," to a few seconds so the link ShareX copies works the moment you paste it.",[46,340,342],{"id":341},"check-what-save-file-reads","Check what Save file reads",[10,344,345,346,349,350,352],{},"Every content step makes a ",[31,347,348],{},"new"," copy of the content and leaves its input alone. Save file stores whichever copy its ",[31,351,83],{}," setting points to. If that's not the last step's output, the work done after it is silently thrown away:",[17,354,357],{"className":355,"code":356,"language":22,"meta":23},[20],"File received → Strip metadata → Resize → Save file\n",[25,358,356],{"__ignoreMap":23},[360,361,362,375],"table",{},[363,364,365],"thead",{},[366,367,368,372],"tr",{},[369,370,371],"th",{},"Save file's Content",[369,373,374],{},"Result",[376,377,378,388],"tbody",{},[366,379,380,385],{},[381,382,383],"td",{},[62,384,174],{},[381,386,387],{},"✗ The resize is lost",[366,389,390,394],{},[381,391,392],{},[62,393,214],{},[381,395,396],{},"✓ The resized image is saved",[10,398,399],{},"The run still succeeds, so this is easy to miss. Tessra helps in two ways:",[164,401,402,408],{},[167,403,404,407],{},[31,405,406],{},"Inserting a step on a connection rewires the next step."," When you insert a content step between two others, the step after it switches to the new step's content, as long as it was reading the same content the new step reads. That's why the steps above didn't need fixing by hand.",[167,409,410,413],{},[31,411,412],{},"The Problems list warns you."," If Save file reads content that an earlier step on its path has already changed, you get a warning that names the step to read from instead.",[10,415,416,417,419],{},"Nothing is rewired when you add a step at the end of the workflow, connect steps by hand, or delete a step. After any of those, select Save file and check its ",[31,418,83],{},". Its value tree lists the content steps nearest first.",[421,422,423],"note",{},[10,424,425,426,428,429,432,433,110],{},"The warning doesn't block publishing, because reading earlier content on purpose is sometimes what you want. For example, a second Save file without ",[31,427,91],{}," can keep the full-size image in an ",[62,430,431],{},"Originals"," folder by reading ",[62,434,174],{},[46,436,438],{"id":437},"variations","Variations",[10,440,441,444,445,447,448,450,451,148,453,262,455,148,457,459],{},[31,442,443],{},"Keep the original too."," Add a second ",[31,446,79],{}," after the first, with ",[31,449,91],{}," off, ",[31,452,83],{},[62,454,87],{},[31,456,261],{},[62,458,431],{},". The original is saved as a separate file with its metadata intact, so keep that folder private.",[10,461,462,465,466,469,470,473,474,473,477,479,480,483,484,487,488,490],{},[31,463,464],{},"Only resize large images."," Insert a ",[31,467,468],{},"Condition"," before Resize with the rule ",[62,471,472],{},"File received › Content › Width"," ",[62,475,476],{},"is greater than",[25,478,184],{},". Put Resize and a Save file on ",[31,481,482],{},"True",", and another Save file reading Strip metadata's content on ",[31,485,486],{},"False",". Turn on ",[31,489,91],{}," in both: they're on different branches of the same Condition, so only one of them runs.",[10,492,493,496,497,499,500,503,504,507,508,511],{},[31,494,495],{},"Convert everything to WebP."," Replace Compress image with ",[31,498,237],{},", format ",[62,501,502],{},"WebP",", quality ",[25,505,506],{},"85",". Files saved this way get a ",[25,509,510],{},".webp"," extension.",{"title":23,"searchDepth":513,"depth":514,"links":515},2,3,[516,517,518,519,520,521,522,523,524,525],{"id":48,"depth":513,"text":49},{"id":95,"depth":513,"text":96},{"id":128,"depth":513,"text":129},{"id":154,"depth":513,"text":155},{"id":201,"depth":513,"text":202},{"id":241,"depth":513,"text":242},{"id":297,"depth":513,"text":298},{"id":307,"depth":513,"text":308},{"id":341,"depth":513,"text":342},{"id":437,"depth":513,"text":438},"An intake workflow that strips metadata, scales down and compresses images before saving them to your library.","md",{},{"icon":530},"i-lucide-file-image","\u002Fautomations\u002Fguides\u002Fcompress-uploads",{"title":5,"description":526},"2.automations\u002F10.guides\u002F1.compress-uploads","avTJhVT_Qd4LSCsrlgdSwCNLMmWvbry9XCT278-kJpw",[536,542],{"title":537,"path":538,"stem":539,"description":540,"icon":541,"children":-1},"Runs and history","\u002Fautomations\u002Fruns","2.automations\u002F09.runs","Follow what a workflow did, retry failed runs, cancel runs, and how long history is kept.","i-lucide-history",{"title":543,"path":544,"stem":545,"description":546,"icon":547,"children":-1},"Step reference","\u002Fautomations\u002Freference\u002Fsteps","2.automations\u002F11.reference\u002F1.steps","Every trigger and step available today, with its settings and the values it produces.","i-lucide-blocks",[549,558],{"title":550,"path":551,"stem":552,"children":553,"icon":557},"Getting started","\u002Fgetting-started","1.getting-started\u002F1.index",[554],{"title":555,"path":551,"stem":552,"icon":556},"Introduction","i-lucide-house",false,{"title":55,"path":559,"stem":560,"children":561,"icon":557},"\u002Fautomations","2.automations\u002F01.index",[562,565,570,575,580,585,590,594,599,600,607],{"title":563,"path":559,"stem":560,"icon":564},"Overview","i-lucide-workflow",{"title":566,"path":567,"stem":568,"icon":569},"Your first workflow","\u002Fautomations\u002Ffirst-workflow","2.automations\u002F02.first-workflow","i-lucide-rocket",{"title":571,"path":572,"stem":573,"icon":574},"The editor","\u002Fautomations\u002Feditor","2.automations\u002F03.editor","i-lucide-mouse-pointer-2",{"title":576,"path":577,"stem":578,"icon":579},"Values and templates","\u002Fautomations\u002Fvalues","2.automations\u002F04.values","i-lucide-braces",{"title":581,"path":582,"stem":583,"icon":584},"Conditions and branching","\u002Fautomations\u002Fbranching","2.automations\u002F05.branching","i-lucide-split",{"title":586,"path":587,"stem":588,"icon":589},"Testing","\u002Fautomations\u002Ftesting","2.automations\u002F06.testing","i-lucide-flask-conical",{"title":68,"path":591,"stem":592,"icon":593},"\u002Fautomations\u002Fintake","2.automations\u002F07.intake","i-lucide-inbox",{"title":595,"path":596,"stem":597,"icon":598},"Quarantine and failures","\u002Fautomations\u002Fquarantine","2.automations\u002F08.quarantine","i-lucide-shield-alert",{"title":537,"path":538,"stem":539,"icon":541},{"title":601,"icon":602,"path":603,"stem":604,"children":605,"page":557},"Guides","i-lucide-book-open","\u002Fautomations\u002Fguides","2.automations\u002F10.guides",[606],{"title":5,"path":531,"stem":533,"icon":530},{"title":608,"icon":609,"path":610,"stem":611,"children":612,"page":557},"Reference","i-lucide-library","\u002Fautomations\u002Freference","2.automations\u002F11.reference",[613,614],{"title":543,"path":544,"stem":545,"icon":547},{"title":615,"path":616,"stem":617,"icon":618},"Limits and errors","\u002Fautomations\u002Freference\u002Flimits","2.automations\u002F11.reference\u002F2.limits","i-lucide-gauge",1796146074618,"7701d6d7-f1dc-48af-abe7-a8319dcc587e"]