Skip to content

Commit

Permalink
Delete trailing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
mathbunnyru committed Jan 11, 2017
1 parent 5f5606b commit e586c6f
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 56 deletions.
24 changes: 12 additions & 12 deletions gifsicle/gifsicle-1.89-imageoptim.patch
Expand Up @@ -3,25 +3,25 @@ index ca3f388..8d11d17 100644
--- a/src/gifsicle.c
+++ b/src/gifsicle.c
@@ -33,7 +33,6 @@ Gt_Frameset *nested_frames = 0;

Gif_Stream *input = 0;
const char *input_name = 0;
-static int unoptimizing = 0;

const int GIFSICLE_DEFAULT_THREAD_COUNT = 8;
int thread_count = 0;
@@ -326,7 +325,6 @@ const Clp_Option options[] = {
Clp_Negate },
{ "transparent", 't', 't', COLOR_TYPE, Clp_Negate },

- { "unoptimize", 'U', UNOPTIMIZE_OPT, 0, Clp_Negate },
{ "use-colormap", 0, USE_COLORMAP_OPT, Clp_ValString, Clp_Negate },

{ "verbose", 'V', VERBOSE_OPT, 0, Clp_Negate },
@@ -760,18 +758,6 @@ input_stream(const char *name)
add_frame(frames, gfs, gfs->images[i]);
def_frame = old_def_frame;

- if (unoptimizing)
- if (!Gif_FullUnoptimize(gfs, GIF_UNOPTIMIZE_SIMPLEST_DISPOSAL)) {
- static int context = 0;
Expand All @@ -36,11 +36,11 @@ index ca3f388..8d11d17 100644
-
apply_color_transforms(input_transforms, gfs);
gfs->refcount++;

@@ -840,62 +826,6 @@ set_new_fixed_colormap(const char *name)
def_output_data.colormap_fixed = read_colormap_file(name, 0);
}

-static void
-do_colormap_change(Gif_Stream *gfs)
-{
Expand Down Expand Up @@ -97,18 +97,18 @@ index ca3f388..8d11d17 100644
- }
-}
-

/*****
* output GIF images
@@ -946,8 +876,7 @@ merge_and_write_frames(const char *outfile, int f1, int f2)
verbose_open('[', outfile ? outfile : "#stdout#");
active_output_data.active_output_name = outfile;

- colormap_change = active_output_data.colormap_size > 0
- || active_output_data.colormap_fixed;
+ colormap_change = 0;
warn_local_colormaps = !colormap_change;

if (!(active_output_data.scaling
@@ -974,8 +903,6 @@ merge_and_write_frames(const char *outfile, int f1, int f2)
active_output_data.scaling == GT_SCALING_RESIZE_FIT,
Expand All @@ -122,7 +122,7 @@ index ca3f388..8d11d17 100644
@@ -1408,17 +1335,6 @@ main(int argc, char *argv[])
pthread_mutex_init(&kd3_sort_lock, 0);
#endif

- /* Yep, I'm an idiot.
- GIF dimensions are unsigned 16-bit integers. I assume that these
- numbers will fit in an 'int'. This assertion tests that assumption.
Expand All @@ -140,7 +140,7 @@ index ca3f388..8d11d17 100644
@@ -1755,11 +1671,6 @@ main(int argc, char *argv[])
break;
}

- case UNOPTIMIZE_OPT:
- UNCHECKED_MARK_CH(input, CH_UNOPTIMIZE);
- unoptimizing = clp->negated ? 0 : 1;
Expand Down
4 changes: 2 additions & 2 deletions imageoptim/GetQueueCountCommand.h
@@ -1,11 +1,11 @@
#import <Cocoa/Cocoa.h>


/* This class implements a simple verb with no parameters. The verb
/* This class implements a simple verb with no parameters. The verb
returns an integer number. Verbs don't get much simpler than this. */

@interface GetQueueCountCommand : NSScriptCommand {

}

- (id)performDefaultImplementation;
Expand Down
6 changes: 3 additions & 3 deletions imageoptim/ImageOptimVerbs.sdef
Expand Up @@ -3,14 +3,14 @@

<!-- declare the namespace for using XInclude so we can include the standard suite -->
<dictionary xmlns:xi="http://www.w3.org/2003/XInclude">

<!-- use XInclude to include the standard suite -->
<!-- excluding for the moment -->
<!-- <xi:include href="file:///System/Library/ScriptingDefinitions/CocoaStandard.sdef" xpointer="xpointer(/dictionary/suite)"/> -->

<!-- specific suite(s) for the application follow... -->
<suite name="ImageOptim Verbs" code="SVrb" description="Terminology for ImageOptim Verbs">

<command name="do queuecount command" code="SVrbSimp" description="get the number of items in the queues">
<cocoa class="GetQueueCountCommand"/>
<result type="integer" description="returns the number of items in the queues"/>
Expand Down
10 changes: 5 additions & 5 deletions imageoptim/Job.h
Expand Up @@ -19,7 +19,7 @@ enum IOFileType {
@interface Job : NSObject <NSCopying, QLPreviewItem> {
NSURL *filePath, *revertPath;
NSString *displayName;

/** size of file before any optimizations */
NSUInteger byteSizeOriginal;
/** expected current size of file on disk, updated before and after optimization */
Expand All @@ -30,22 +30,22 @@ enum IOFileType {
NSString *bestToolName;
NSMutableDictionary *bestTools;
double percentDone;

NSMutableSet *filePathsOptimizedInUse;
NSURL *filePathOptimized;

NSString *statusImageName;
NSString *statusText;
NSInteger statusOrder;

NSMutableArray *workers;
NSMutableDictionary *workersPreviousResults;

NSOperationQueue *fileIOQueue;
ResultsDb *db;
uint32_t settingsHash[4];
uint32_t inputFileHash[4];

enum IOFileType fileType;
BOOL done, failed, optimized, stopping, lossyConverted;
}
Expand Down
8 changes: 4 additions & 4 deletions imageoptim/Job.m
Expand Up @@ -528,22 +528,22 @@ -(void)doEnqueueWorkersInCPUQueue:(nonnull NSOperationQueue *)queue defaults:(no
lossyConverted = YES;
}
}

BOOL pngcrushEnabled = [defs boolForKey:@"PngCrushEnabled"];
BOOL optipngEnabled = [defs boolForKey:@"OptiPngEnabled"];
BOOL pngoutEnabled = [defs boolForKey:@"PngOutEnabled"];
BOOL zopfliEnabled = [defs boolForKey:@"ZopfliEnabled"];
BOOL advpngEnabled = [defs boolForKey:@"AdvPngEnabled"];
BOOL removePNGChunks = [defs boolForKey:@"PngOutRemoveChunks"];

if (level < 4 && zopfliEnabled) {
pngoutEnabled = NO;
}

if (level < 2 && optipngEnabled) {
pngcrushEnabled = NO;
}

if (pngcrushEnabled) [worker_list addObject:[[PngCrushWorker alloc] initWithLevel:level defaults:defs file:self]];
if (optipngEnabled) [worker_list addObject:[[OptiPngWorker alloc] initWithLevel:level file:self]];
if (pngoutEnabled) [worker_list addObject:[[PngoutWorker alloc] initWithLevel:level defaults:defs file:self]];
Expand Down
2 changes: 1 addition & 1 deletion imageoptim/SavingsFormatter.h
Expand Up @@ -6,6 +6,6 @@

#import <Foundation/Foundation.h>

@interface SavingsFormatter : NSNumberFormatter
@interface SavingsFormatter : NSNumberFormatter

@end
4 changes: 2 additions & 2 deletions imageoptim/Workers/AdvCompWorker.h
Expand Up @@ -9,8 +9,8 @@

@interface AdvCompWorker : CommandWorker {
NSInteger level;
NSInteger fileSizeOptimized;

NSInteger fileSizeOptimized;
}

- (instancetype)initWithLevel:(NSInteger)opt file:(Job *)aFile;
Expand Down
8 changes: 4 additions & 4 deletions imageoptim/Workers/OptiPngWorker.h
Expand Up @@ -9,11 +9,11 @@

@interface OptiPngWorker : CommandWorker {
NSInteger optlevel, interlace;


NSInteger idatSize;
NSUInteger fileSize;
NSUInteger fileSizeOptimized;
NSUInteger fileSize;
NSUInteger fileSizeOptimized;
}

-(instancetype)initWithLevel:(NSInteger)level file:(Job *)aFile;
Expand Down
4 changes: 2 additions & 2 deletions imageoptim/Workers/PngCrushWorker.h
Expand Up @@ -7,8 +7,8 @@
#import <Cocoa/Cocoa.h>
#import "CommandWorker.h"

@interface PngCrushWorker : CommandWorker {
int firstIdatSize;
@interface PngCrushWorker : CommandWorker {
int firstIdatSize;
BOOL strip, brute;
}

Expand Down
2 changes: 1 addition & 1 deletion imageoptim/Workers/PngoutWorker.h
Expand Up @@ -10,7 +10,7 @@
@interface PngoutWorker : CommandWorker {
BOOL removechunks;
NSInteger level, timelimit;

NSInteger fileSizeOptimized;
}

Expand Down
28 changes: 14 additions & 14 deletions optipng/dirtyalpha.patch
Expand Up @@ -17,7 +17,7 @@ index e4d5c98..5e82152 100644
@@ -1151,6 +1151,69 @@ opng_analyze_sample_usage(png_structp png_ptr, png_infop info_ptr,
usage_map[info_ptr->background.index] = 1;
}

+/*
+ * Remove RGB components or transparent pixels in RGB+alpha images.
+ * The function returns OPNG_REDUCE_DIRTY_ALPHA if any pixels were cleared.
Expand Down Expand Up @@ -81,7 +81,7 @@ index e4d5c98..5e82152 100644
+}
+
+

/*
* Reduce the palette (only the fast method is implemented).
@@ -1339,7 +1402,7 @@ opng_reduce_image(png_structp png_ptr, png_infop info_ptr,
Expand All @@ -90,13 +90,13 @@ index e4d5c98..5e82152 100644
unsigned int color_type;
- png_uint_32 result;
+ png_uint_32 result = 0;

opng_debug(1, "in opng_reduce_image_type");

@@ -1354,8 +1417,14 @@ opng_reduce_image(png_structp png_ptr, png_infop info_ptr,

/* The reductions below must be applied in the given order. */

+ if ((color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
+ color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
+ && (reductions & OPNG_REDUCE_DIRTY_ALPHA)
Expand All @@ -106,7 +106,7 @@ index e4d5c98..5e82152 100644
/* Try to reduce the high bits and color/alpha channels. */
- result = opng_reduce_bits(png_ptr, info_ptr, reductions);
+ result |= opng_reduce_bits(png_ptr, info_ptr, reductions);

/* Try to reduce the palette image. */
if (color_type == PNG_COLOR_TYPE_PALETTE &&
diff --git a/src/opngreduc.h b/src/opngreduc.h
Expand All @@ -120,17 +120,17 @@ index 23f2eb0..a9f27e3 100644
+#define OPNG_REDUCE_DIRTY_ALPHA 0x0400 /* zero RGB components of
+ transparent pixels */
#define OPNG_REDUCE_ANCILLARY 0x1000

#define OPNG_REDUCE_BIT_DEPTH \
@@ -89,7 +91,7 @@ png_uint_32 PNGAPI opng_reduce_image(png_structp png_ptr, png_infop info_ptr,

#define OPNG_REDUCE_ALL \
(OPNG_REDUCE_BIT_DEPTH | OPNG_REDUCE_COLOR_TYPE | \
- OPNG_REDUCE_PALETTE_ALL | OPNG_REDUCE_ANCILLARY)
+ OPNG_REDUCE_PALETTE_ALL | OPNG_REDUCE_ANCILLARY | OPNG_REDUCE_DIRTY_ALPHA)

#endif /* OPNG_IMAGE_REDUCTIONS_SUPPORTED */

diff --git a/src/optipng.c b/src/optipng.c
index 1768859..06b4902 100644
--- a/src/optipng.c
Expand All @@ -156,16 +156,16 @@ index 1768859..06b4902 100644
/* -nz */
@@ -846,9 +851,9 @@ app_print_cntrl(int cntrl_code)
}

if (con_file != NULL)
- fputs(con_str, con_file);
+ fprintf(con_file, "%s",con_str);
if (log_file != NULL)
- fputs(log_str, log_file);
+ fprintf(log_file, "%s",log_str);
}


diff --git a/src/optipng.h b/src/optipng.h
index cb6343e..55c4b2b 100644
--- a/src/optipng.h
Expand Down
2 changes: 1 addition & 1 deletion optipng/remove_nonpng_formats.patch
Expand Up @@ -10,7 +10,7 @@ index e0744d3..a3fc2db 100644
FILE *stream;
fpos_t fpos;
- int result;

/* Precondition. */
#ifdef PNG_FLAG_MALLOC_NULL_MEM_OK
@@ -110,26 +108,5 @@ pngx_read_image(png_structp png_ptr, png_infop info_ptr,
Expand Down
10 changes: 5 additions & 5 deletions pngcrush/pngcrush.patch
Expand Up @@ -17,15 +17,15 @@ index 21b6e3b..08e882e 100644
- keystroke = keystroke; /* stifle compiler warning */
}
}

@@ -3194,7 +3192,6 @@ void pngcrush_write_png(png_structp write_pointer, png_bytep data,
static void pngcrush_flush(png_structp png_ptr)
{
/* Do nothing. */
- PNGCRUSH_UNUSED(png_ptr)
}


@@ -3247,6 +3244,7 @@ void pngcrush_examine_pixels_fn(png_structp png_ptr, png_row_infop
if ((row_info->color_type == 2 || row_info->color_type == 6) &&
make_gray == 1) /* RGB */
Expand All @@ -39,13 +39,13 @@ index 21b6e3b..08e882e 100644
{
i = (int) row_info->rowbytes-1;
+ make_gray = 2;

if (row_info->bit_depth == 8)
{
@@ -8281,7 +8280,7 @@ png_uint_32 pngcrush_measure_idat(png_structp png_ptr)
printf(" Reading %c%c%c%c chunk.\n",
chunk_name[0],chunk_name[1],chunk_name[2],chunk_name[3]);

- if (new_mng)
+ if (0)
{
Expand Down

0 comments on commit e586c6f

Please sign in to comment.