@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use "-dispose background" to improve reassembly of GIFs with transparency

Summary:
Fixes T5741. We break GIFs apart with "-coalesce" which completely rasterizes each frame, but stitch them back together without specifying "-dispose".

This produces the default "-dispose none" behavior, which causes GIF frames to "pile up" if they contain transparency.

Instead, use "-dispose background" so that the previous frame is erased before each new frame is drawn.

Test Plan: See T5741 for additional details.

Maniphest Tasks: T5741

Differential Revision: https://secure.phabricator.com/D19214

+9 -3
+9 -3
src/applications/macro/engine/PhabricatorMemeEngine.php
··· 236 236 Filesystem::writeFile($output_name, $memed_frame_data); 237 237 } 238 238 239 - $future = new ExecFuture('convert -loop 0 %Ls %s', $output_files, $output); 239 + $future = new ExecFuture( 240 + 'convert -dispose background -loop 0 %Ls %s', 241 + $output_files, 242 + $output); 240 243 $future->setTimeout(10)->resolvex(); 241 244 242 245 return Filesystem::readFile($output); ··· 297 300 $font_max = 72; 298 301 $font_min = 5; 299 302 303 + $margin_x = 16; 304 + $margin_y = 16; 305 + 300 306 $last = null; 301 307 $cursor = floor(($font_max + $font_min) / 2); 302 308 $min = $font_min; ··· 321 327 // text extends, for example if it has a "y". 322 328 $descend = $box[3]; 323 329 324 - if ($height > $dim_y) { 330 + if (($height + $margin_y) > $dim_y) { 325 331 $all_fit = false; 326 332 break; 327 333 } 328 334 329 - if ($width > $dim_x) { 335 + if (($width + $margin_x) > $dim_x) { 330 336 $all_fit = false; 331 337 break; 332 338 }