diff --git a/.editorconfig b/.editorconfig index 0e4883082c..83670fa830 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,373 +1,436 @@ -############################################################################### -# EditorConfig is awesome: http://EditorConfig.org -############################################################################### +# Version: 1.6.2 (Using https://semver.org/) +# Updated: 2020-11-02 +# See https://github.com/RehanSaeed/EditorConfig/releases for release notes. +# See https://github.com/RehanSaeed/EditorConfig for updates to this file. +# See http://EditorConfig.org for more information about .editorconfig files. -############################################################################### -# Top-most EditorConfig file -############################################################################### +########################################## +# Common Settings +########################################## + +# This file is the top-most EditorConfig file root = true -############################################################################### -# Set default behavior to: -# a UTF-8 encoding, -# Unix-style line endings, -# a newline ending the file, -# 4 space indentation, and -# trimming of trailing whitespace -############################################################################### +# All Files [*] charset = utf-8 -end_of_line = lf -insert_final_newline = true indent_style = space indent_size = 4 +end_of_line = lf +insert_final_newline = true trim_trailing_whitespace = true -############################################################################### -# Set file behavior to: -# 2 space indentation -############################################################################### -[*.{cmd,config,csproj,json,props,ps1,resx,sh,targets}] -indent_size = 2 +########################################## +# File Extension Settings +########################################## -############################################################################### -# Set file behavior to: -# Windows-style line endings, and -# tabular indentation -############################################################################### +# Visual Studio Solution Files [*.sln] +indent_style = tab + +# Visual Studio XML Project Files +[*.{csproj,vbproj,vcxproj.filters,proj,projitems,shproj}] +indent_size = 2 + +# T4 Templates Files +[*.{tt,ttinclude}] end_of_line = crlf + +# XML Configuration Files +[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct}] +indent_size = 2 + +# JSON Files +[*.{json,json5,webmanifest}] +indent_size = 2 + +# YAML Files +[*.{yml,yaml}] +indent_size = 2 + +# Markdown Files +[*.md] +trim_trailing_whitespace = false + +# Web Files +[*.{htm,html,js,jsm,ts,tsx,css,sass,scss,less,svg,vue}] +indent_size = 2 + +# Batch Files +[*.{cmd,bat}] +end_of_line = crlf + +# Makefiles +[Makefile] indent_style = tab -############################################################################### -# Set dotnet naming rules to: -# suggest async members be pascal case suffixed with Async -# suggest const declarations be pascal case -# suggest interfaces be pascal case prefixed with I -# suggest parameters be camel case -# suggest private and internal static fields be camel case -# suggest private and internal fields be camel case -# suggest public and protected declarations be pascal case -# suggest static readonly declarations be pascal case -# suggest type parameters be prefixed with T -############################################################################### -[*.cs] -dotnet_naming_rule.async_members_should_be_pascal_case_suffixed_with_async.severity = suggestion -dotnet_naming_rule.async_members_should_be_pascal_case_suffixed_with_async.style = pascal_case_suffixed_with_async -dotnet_naming_rule.async_members_should_be_pascal_case_suffixed_with_async.symbols = async_members - -dotnet_naming_rule.const_declarations_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.const_declarations_should_be_pascal_case.style = pascal_case -dotnet_naming_rule.const_declarations_should_be_pascal_case.symbols = const_declarations - -dotnet_naming_rule.interfaces_should_be_pascal_case_prefixed_with_i.severity = suggestion -dotnet_naming_rule.interfaces_should_be_pascal_case_prefixed_with_i.style = pascal_case_prefixed_with_i -dotnet_naming_rule.interfaces_should_be_pascal_case_prefixed_with_i.symbols = interfaces - -dotnet_naming_rule.parameters_should_be_camel_case.severity = suggestion -dotnet_naming_rule.parameters_should_be_camel_case.style = camel_case -dotnet_naming_rule.parameters_should_be_camel_case.symbols = parameters - -dotnet_naming_rule.private_and_internal_static_fields_should_be_camel_case.severity = suggestion -dotnet_naming_rule.private_and_internal_static_fields_should_be_camel_case.style = camel_case -dotnet_naming_rule.private_and_internal_static_fields_should_be_camel_case.symbols = private_and_internal_static_fields - -dotnet_naming_rule.private_and_internal_fields_should_be_camel_case.severity = suggestion -dotnet_naming_rule.private_and_internal_fields_should_be_camel_case.style = camel_case -dotnet_naming_rule.private_and_internal_fields_should_be_camel_case.symbols = private_and_internal_fields - -dotnet_naming_rule.public_and_protected_declarations_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.public_and_protected_declarations_should_be_pascal_case.style = pascal_case -dotnet_naming_rule.public_and_protected_declarations_should_be_pascal_case.symbols = public_and_protected_declarations -dotnet_naming_symbols.public_and_protected_declarations.applicable_kinds = method, field, event, property - -dotnet_naming_rule.static_readonly_declarations_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.static_readonly_declarations_should_be_pascal_case.style = pascal_case -dotnet_naming_rule.static_readonly_declarations_should_be_pascal_case.symbols = static_readonly_declarations - -dotnet_naming_rule.type_parameters_should_be_pascal_case_prefixed_with_t.severity = suggestion -dotnet_naming_rule.type_parameters_should_be_pascal_case_prefixed_with_t.style = pascal_case_prefixed_with_t -dotnet_naming_rule.type_parameters_should_be_pascal_case_prefixed_with_t.symbols = type_parameters - -############################################################################### -# Set dotnet naming styles to define: -# camel case -# pascal case -# pascal case suffixed with Async -# pascal case prefixed with I -# pascal case prefixed with T -############################################################################### -[*.cs] -dotnet_naming_style.camel_case.capitalization = camel_case - -dotnet_naming_style.pascal_case.capitalization = pascal_case - -dotnet_naming_style.pascal_case_suffixed_with_async.capitalization = pascal_case -dotnet_naming_style.pascal_case_suffixed_with_async.required_suffix = Async - -dotnet_naming_style.pascal_case_prefixed_with_i.capitalization = pascal_case -dotnet_naming_style.pascal_case_prefixed_with_i.required_prefix = I - -dotnet_naming_style.pascal_case_prefixed_with_t.capitalization = pascal_case -dotnet_naming_style.pascal_case_prefixed_with_t.required_prefix = T - -############################################################################### -# Set dotnet naming symbols to: -# async members -# const declarations -# interfaces -# private and internal fields -# private and internal static fields -# public and protected declarations -# static readonly declarations -# type parameters -############################################################################### -[*.cs] -dotnet_naming_symbols.async_members.required_modifiers = async - -dotnet_naming_symbols.const_declarations.required_modifiers = const - -dotnet_naming_symbols.interfaces.applicable_kinds = interface - -dotnet_naming_symbols.parameters.applicable_kinds = parameter - -dotnet_naming_symbols.private_and_internal_fields.applicable_accessibilities = private, internal -dotnet_naming_symbols.private_and_internal_fields.applicable_kinds = field - -dotnet_naming_symbols.private_and_internal_static_fields.applicable_accessibilities = private, internal -dotnet_naming_symbols.private_and_internal_static_fields.applicable_kinds = field -dotnet_naming_symbols.private_and_internal_static_fields.required_modifiers = static - -dotnet_naming_symbols.public_and_protected_declarations.applicable_accessibilities = public, protected - -dotnet_naming_symbols.static_readonly_declarations.required_modifiers = static, readonly - -dotnet_naming_symbols.type_parameters.applicable_kinds = type_parameter - -############################################################################### -# Set dotnet sort options to: -# do not separate import directives into groups, and -# sort system directives first -############################################################################### -[*.cs] -dotnet_separate_import_directive_groups = false -dotnet_sort_system_directives_first = true +########################################## +# File Header (Uncomment to support file headers) +# https://docs.microsoft.com/visualstudio/ide/reference/add-file-header +########################################## -############################################################################### -# Set dotnet style options to: -# suggest null-coalescing expressions, -# suggest collection-initializers, -# suggest explicit tuple names, -# suggest null-propogation -# suggest object-initializers, -# generate parentheses in arithmetic binary operators for clarity, -# generate parentheses in other binary operators for clarity, -# don't generate parentheses in other operators if unnecessary, -# generate parentheses in relational binary operators for clarity, -# warn when not using predefined-types for locals, parameters, and members, -# generate predefined-types of type names for member access, -# generate auto properties, -# suggest compound assignment, -# generate conditional expression over assignment, -# generate conditional expression over return, -# suggest inferred anonymous types, -# suggest inferred tuple names, -# suggest 'is null' checks over '== null', -# don't generate 'this.' and 'Me.' for events, -# warn when not using 'this.' and 'Me.' for fields, -# warn when not using 'this.' and 'Me.' for methods, -# warn when not using 'this.' and 'Me.' for properties, -# suggest readonly fields, and -# generate accessibility modifiers for non interface members -############################################################################### -[*.cs] -dotnet_style_coalesce_expression = true:suggestion -dotnet_style_collection_initializer = true:suggestion -dotnet_style_explicit_tuple_names = true:suggestion -dotnet_style_null_propagation = true:suggestion -dotnet_style_object_initializer = true:suggestion - -dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent -dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent -dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent -dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent +# [*.{cs,csx,cake,vb,vbx,tt,ttinclude}] +file_header_template = Copyright (c) Six Labors.\nLicensed under the Apache License, Version 2.0. -dotnet_style_predefined_type_for_locals_parameters_members = true:warning -dotnet_style_predefined_type_for_member_access = true:silent +# SA1636: File header copyright text should match +# Justification: .editorconfig supports file headers. If this is changed to a value other than "none", a stylecop.json file will need to added to the project. +# dotnet_diagnostic.SA1636.severity = none -dotnet_style_prefer_auto_properties = true:silent -dotnet_style_prefer_compound_assignment = true:suggestion -dotnet_style_prefer_conditional_expression_over_assignment = true:silent -dotnet_style_prefer_conditional_expression_over_return = true:silent -dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion -dotnet_style_prefer_inferred_tuple_names = true:suggestion -dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +########################################## +# .NET Language Conventions +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions +########################################## -dotnet_style_qualification_for_event = false:silent +# .NET Code Style Settings +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#net-code-style-settings +[*.{cs,csx,cake,vb,vbx}] +# "this." and "Me." qualifiers +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#this-and-me dotnet_style_qualification_for_field = true:warning -dotnet_style_qualification_for_method = true:warning dotnet_style_qualification_for_property = true:warning - -dotnet_style_readonly_field = true:suggestion -dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent - -############################################################################### -# Set dotnet style options to: -# suggest removing all unused parameters -############################################################################### -[*.cs] -dotnet_code_quality_unused_parameters = all:suggestion - -############################################################################### -# Set csharp indent options to: -# indent block contents, -# not indent braces, -# indent case contents, -# not indent case contents when block, -# indent labels one less than the current, and -# indent switch labels -############################################################################### -[*.cs] -csharp_indent_block_contents = true -csharp_indent_braces = false -csharp_indent_case_contents = true -csharp_indent_case_contents_when_block = false -csharp_indent_labels = one_less_than_current -csharp_indent_switch_labels = true - -############################################################################### -# Set csharp new-line options to: -# insert a new-line before "catch", -# insert a new-line before "else", -# insert a new-line before "finally", -# insert a new-line before members in anonymous-types, -# insert a new-line before members in object-initializers, and -# insert a new-line before all open braces -############################################################################### -[*.cs] -csharp_new_line_before_catch = true +dotnet_style_qualification_for_method = true:warning +dotnet_style_qualification_for_event = true:warning +# Language keywords instead of framework type names for type references +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#language-keywords +dotnet_style_predefined_type_for_locals_parameters_members = true:warning +dotnet_style_predefined_type_for_member_access = true:warning +# Modifier preferences +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#normalize-modifiers +dotnet_style_require_accessibility_modifiers = always:warning +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning +visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:warning +dotnet_style_readonly_field = true:warning +# Parentheses preferences +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parentheses-preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion +# Expression-level preferences +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences +dotnet_style_object_initializer = true:warning +dotnet_style_collection_initializer = true:warning +dotnet_style_explicit_tuple_names = true:warning +dotnet_style_prefer_inferred_tuple_names = true:warning +dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning +dotnet_style_prefer_auto_properties = true:warning +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning +dotnet_style_prefer_conditional_expression_over_assignment = false:suggestion +dotnet_style_prefer_conditional_expression_over_return = false:suggestion +dotnet_style_prefer_compound_assignment = true:warning +# Null-checking preferences +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#null-checking-preferences +dotnet_style_coalesce_expression = true:warning +dotnet_style_null_propagation = true:warning +# Parameter preferences +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parameter-preferences +dotnet_code_quality_unused_parameters = all:warning +# More style options (Undocumented) +# https://github.com/MicrosoftDocs/visualstudio-docs/issues/3641 +dotnet_style_operator_placement_when_wrapping = end_of_line +# https://github.com/dotnet/roslyn/pull/40070 +dotnet_style_prefer_simplified_interpolation = true:warning + +# C# Code Style Settings +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-code-style-settings +[*.{cs,csx,cake}] +# Implicit and explicit types +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#implicit-and-explicit-types +csharp_style_var_for_built_in_types = never +csharp_style_var_when_type_is_apparent = true:warning +csharp_style_var_elsewhere = false:warning +# Expression-bodied members +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-bodied-members +csharp_style_expression_bodied_methods = true:warning +csharp_style_expression_bodied_constructors = true:warning +csharp_style_expression_bodied_operators = true:warning +csharp_style_expression_bodied_properties = true:warning +csharp_style_expression_bodied_indexers = true:warning +csharp_style_expression_bodied_accessors = true:warning +csharp_style_expression_bodied_lambdas = true:warning +csharp_style_expression_bodied_local_functions = true:warning +# Pattern matching +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#pattern-matching +csharp_style_pattern_matching_over_is_with_cast_check = true:warning +csharp_style_pattern_matching_over_as_with_null_check = true:warning +# Inlined variable declarations +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#inlined-variable-declarations +csharp_style_inlined_variable_declaration = true:warning +# Expression-level preferences +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences +csharp_prefer_simple_default_expression = true:warning +# "Null" checking preferences +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-null-checking-preferences +csharp_style_throw_expression = true:warning +csharp_style_conditional_delegate_call = true:warning +# Code block preferences +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#code-block-preferences +csharp_prefer_braces = true:warning +# Unused value preferences +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#unused-value-preferences +csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion +csharp_style_unused_value_assignment_preference = discard_variable:suggestion +# Index and range preferences +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#index-and-range-preferences +csharp_style_prefer_index_operator = true:warning +csharp_style_prefer_range_operator = true:warning +# Miscellaneous preferences +# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#miscellaneous-preferences +csharp_style_deconstructed_variable_declaration = true:warning +csharp_style_pattern_local_over_anonymous_function = true:warning +csharp_using_directive_placement = outside_namespace:warning +csharp_prefer_static_local_function = true:warning +csharp_prefer_simple_using_statement = true:suggestion + +########################################## +# .NET Formatting Conventions +# https://docs.microsoft.com/visualstudio/ide/editorconfig-code-style-settings-reference#formatting-conventions +########################################## + +# Organize usings +# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#organize-using-directives +dotnet_sort_system_directives_first = true +# Newline options +# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#new-line-options +csharp_new_line_before_open_brace = all csharp_new_line_before_else = true +csharp_new_line_before_catch = true csharp_new_line_before_finally = true - -csharp_new_line_before_members_in_anonymous_types = true csharp_new_line_before_members_in_object_initializers = true - -csharp_new_line_before_open_brace = all - -############################################################################### -# Set csharp preserve options to: -# preserve single-line blocks, and -# preserve single-line statements -############################################################################### -[*.cs] -csharp_preserve_single_line_blocks = true -csharp_preserve_single_line_statements = true - -############################################################################### -# Set csharp space options to: -# remove any space after a cast, -# add a space after the colon in an inheritance clause, -# add a space after a comma, -# remove any space after a dot, -# add a space after keywords in control flow statements, -# add a space after a semicolon in a "for" statement, -# add a space before and after binary operators, -# remove space around declaration statements, -# add a space before the colon in an inheritance clause, -# remove any space before a comma, -# remove any space before a dot, -# remove any space before an open square-bracket, -# remove any space before a semicolon in a "for" statement, -# remove any space between empty square-brackets, -# remove any space between a method call's empty parameter list parenthesis, -# remove any space between a method call's name and its opening parenthesis, -# remove any space between a method call's parameter list parenthesis, -# remove any space between a method declaration's empty parameter list parenthesis, -# remove any space between a method declaration's name and its openening parenthesis, -# remove any space between a method declaration's parameter list parenthesis, -# remove any space between parentheses, and -# remove any space between square brackets -############################################################################### -[*.cs] +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true +# Indentation options +# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#indentation-options +csharp_indent_case_contents = true +csharp_indent_switch_labels = true +csharp_indent_labels = no_change +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents_when_block = false +# Spacing options +# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#spacing-options csharp_space_after_cast = false -csharp_space_after_colon_in_inheritance_clause = true -csharp_space_after_comma = true -csharp_space_after_dot = false csharp_space_after_keywords_in_control_flow_statements = true -csharp_space_after_semicolon_in_for_statement = true - -csharp_space_around_binary_operators = before_and_after -csharp_space_around_declaration_statements = do_not_ignore - +csharp_space_between_parentheses = false csharp_space_before_colon_in_inheritance_clause = true +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_around_binary_operators = before_and_after +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_after_comma = true csharp_space_before_comma = false +csharp_space_after_dot = false csharp_space_before_dot = false -csharp_space_before_open_square_brackets = false +csharp_space_after_semicolon_in_for_statement = true csharp_space_before_semicolon_in_for_statement = false - +csharp_space_around_declaration_statements = false +csharp_space_before_open_square_brackets = false csharp_space_between_empty_square_brackets = false -csharp_space_between_method_call_empty_parameter_list_parentheses = false -csharp_space_between_method_call_name_and_opening_parenthesis = false -csharp_space_between_method_call_parameter_list_parentheses = false -csharp_space_between_method_declaration_empty_parameter_list_parentheses = false -csharp_space_between_method_declaration_name_and_open_parenthesis = false -csharp_space_between_method_declaration_parameter_list_parentheses = false -csharp_space_between_parentheses = false csharp_space_between_square_brackets = false +# Wrapping options +# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#wrap-options +csharp_preserve_single_line_statements = false +csharp_preserve_single_line_blocks = true -############################################################################### -# Set csharp style options to: -# generate braces, -# suggest simple default expressions, -# generate a preferred modifier order, -# suggest conditional delegate calls, -# suggest deconstructed variable declarations, -# generate expression-bodied accessors, -# generate expression-bodied constructors, -# generate expression-bodied indexers, -# generate expression-bodied lambdas, -# generate expression-bodied methods, -# generate expression-bodied operators, -# generate expression-bodied properties, -# suggest inlined variable declarations, -# suggest local over anonymous functions, -# suggest pattern-matching over "as" with "null" check, -# suggest pattern-matching over "is" with "cast" check, -# suggest throw expressions, -# generate a discard variable for unused value expression statements, -# suggest a discard variable for unused assignments, -# warn when using var for built-in types, -# warn when using var when the type is not apparent, and -# warn when not using var when the type is apparent -# warn when using simplified "using" declaration -############################################################################### -[*.cs] -csharp_prefer_braces = true:silent -csharp_prefer_simple_default_expression = true:suggestion -csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent - -csharp_style_conditional_delegate_call = true:suggestion -csharp_style_deconstructed_variable_declaration = true:suggestion - -csharp_style_expression_bodied_accessors = true:silent -csharp_style_expression_bodied_constructors = true:silent -csharp_style_expression_bodied_indexers = true:silent -csharp_style_expression_bodied_lambdas = true:silent -csharp_style_expression_bodied_methods = true:silent -csharp_style_expression_bodied_operators = true:silent -csharp_style_expression_bodied_properties = true:silent - -csharp_style_inlined_variable_declaration = true:suggestion - -csharp_style_pattern_local_over_anonymous_function = true:suggestion -csharp_style_pattern_matching_over_as_with_null_check = true:suggestion -csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion - -csharp_style_throw_expression = true:suggestion - -csharp_style_unused_value_expression_statement_preference = discard_variable:silent -csharp_style_unused_value_assignment_preference = discard_variable:suggestion - -csharp_style_var_for_built_in_types = never -csharp_style_var_when_type_is_apparent = true:warning -csharp_style_var_elsewhere = false:warning +########################################## +# .NET Naming Conventions +# https://docs.microsoft.com/visualstudio/ide/editorconfig-naming-conventions +########################################## + +[*.{cs,csx,cake,vb,vbx}] + +########################################## +# Styles +########################################## + +# camel_case_style - Define the camelCase style +dotnet_naming_style.camel_case_style.capitalization = camel_case +# pascal_case_style - Define the PascalCase style +dotnet_naming_style.pascal_case_style.capitalization = pascal_case +# first_upper_style - The first character must start with an upper-case character +dotnet_naming_style.first_upper_style.capitalization = first_word_upper +# prefix_interface_with_i_style - Interfaces must be PascalCase and the first character of an interface must be an 'I' +dotnet_naming_style.prefix_interface_with_i_style.capitalization = pascal_case +dotnet_naming_style.prefix_interface_with_i_style.required_prefix = I +# prefix_type_parameters_with_t_style - Generic Type Parameters must be PascalCase and the first character must be a 'T' +dotnet_naming_style.prefix_type_parameters_with_t_style.capitalization = pascal_case +dotnet_naming_style.prefix_type_parameters_with_t_style.required_prefix = T +# disallowed_style - Anything that has this style applied is marked as disallowed +dotnet_naming_style.disallowed_style.capitalization = pascal_case +dotnet_naming_style.disallowed_style.required_prefix = ____RULE_VIOLATION____ +dotnet_naming_style.disallowed_style.required_suffix = ____RULE_VIOLATION____ +# internal_error_style - This style should never occur... if it does, it indicates a bug in file or in the parser using the file +dotnet_naming_style.internal_error_style.capitalization = pascal_case +dotnet_naming_style.internal_error_style.required_prefix = ____INTERNAL_ERROR____ +dotnet_naming_style.internal_error_style.required_suffix = ____INTERNAL_ERROR____ + +########################################## +# .NET Design Guideline Field Naming Rules +# Naming rules for fields follow the .NET Framework design guidelines +# https://docs.microsoft.com/dotnet/standard/design-guidelines/index +########################################## + +# All public/protected/protected_internal constant fields must be PascalCase +# https://docs.microsoft.com/dotnet/standard/design-guidelines/field +dotnet_naming_symbols.public_protected_constant_fields_group.applicable_accessibilities = public, protected, protected_internal +dotnet_naming_symbols.public_protected_constant_fields_group.required_modifiers = const +dotnet_naming_symbols.public_protected_constant_fields_group.applicable_kinds = field +dotnet_naming_rule.public_protected_constant_fields_must_be_pascal_case_rule.symbols = public_protected_constant_fields_group +dotnet_naming_rule.public_protected_constant_fields_must_be_pascal_case_rule.style = pascal_case_style +dotnet_naming_rule.public_protected_constant_fields_must_be_pascal_case_rule.severity = warning + +# All public/protected/protected_internal static readonly fields must be PascalCase +# https://docs.microsoft.com/dotnet/standard/design-guidelines/field +dotnet_naming_symbols.public_protected_static_readonly_fields_group.applicable_accessibilities = public, protected, protected_internal +dotnet_naming_symbols.public_protected_static_readonly_fields_group.required_modifiers = static, readonly +dotnet_naming_symbols.public_protected_static_readonly_fields_group.applicable_kinds = field +dotnet_naming_rule.public_protected_static_readonly_fields_must_be_pascal_case_rule.symbols = public_protected_static_readonly_fields_group +dotnet_naming_rule.public_protected_static_readonly_fields_must_be_pascal_case_rule.style = pascal_case_style +dotnet_naming_rule.public_protected_static_readonly_fields_must_be_pascal_case_rule.severity = warning + +# No other public/protected/protected_internal fields are allowed +# https://docs.microsoft.com/dotnet/standard/design-guidelines/field +dotnet_naming_symbols.other_public_protected_fields_group.applicable_accessibilities = public, protected, protected_internal +dotnet_naming_symbols.other_public_protected_fields_group.applicable_kinds = field +dotnet_naming_rule.other_public_protected_fields_disallowed_rule.symbols = other_public_protected_fields_group +dotnet_naming_rule.other_public_protected_fields_disallowed_rule.style = disallowed_style +dotnet_naming_rule.other_public_protected_fields_disallowed_rule.severity = error + +########################################## +# StyleCop Field Naming Rules +# Naming rules for fields follow the StyleCop analyzers +# This does not override any rules using disallowed_style above +# https://github.com/DotNetAnalyzers/StyleCopAnalyzers +########################################## + +# All constant fields must be PascalCase +# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1303.md +dotnet_naming_symbols.stylecop_constant_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected, private +dotnet_naming_symbols.stylecop_constant_fields_group.required_modifiers = const +dotnet_naming_symbols.stylecop_constant_fields_group.applicable_kinds = field +dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.symbols = stylecop_constant_fields_group +dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.style = pascal_case_style +dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.severity = warning + +# All static readonly fields must be PascalCase +# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1311.md +dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected, private +dotnet_naming_symbols.stylecop_static_readonly_fields_group.required_modifiers = static, readonly +dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_kinds = field +dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.symbols = stylecop_static_readonly_fields_group +dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.style = pascal_case_style +dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.severity = warning + +# No non-private instance fields are allowed +# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1401.md +dotnet_naming_symbols.stylecop_fields_must_be_private_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected +dotnet_naming_symbols.stylecop_fields_must_be_private_group.applicable_kinds = field +dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.symbols = stylecop_fields_must_be_private_group +dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.style = disallowed_style +dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.severity = error + +# Private fields must be camelCase +# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1306.md +dotnet_naming_symbols.stylecop_private_fields_group.applicable_accessibilities = private +dotnet_naming_symbols.stylecop_private_fields_group.applicable_kinds = field +dotnet_naming_rule.stylecop_private_fields_must_be_camel_case_rule.symbols = stylecop_private_fields_group +dotnet_naming_rule.stylecop_private_fields_must_be_camel_case_rule.style = camel_case_style +dotnet_naming_rule.stylecop_private_fields_must_be_camel_case_rule.severity = warning + +# Local variables must be camelCase +# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1312.md +dotnet_naming_symbols.stylecop_local_fields_group.applicable_accessibilities = local +dotnet_naming_symbols.stylecop_local_fields_group.applicable_kinds = local +dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.symbols = stylecop_local_fields_group +dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.style = camel_case_style +dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.severity = silent + +# This rule should never fire. However, it's included for at least two purposes: +# First, it helps to understand, reason about, and root-case certain types of issues, such as bugs in .editorconfig parsers. +# Second, it helps to raise immediate awareness if a new field type is added (as occurred recently in C#). +dotnet_naming_symbols.sanity_check_uncovered_field_case_group.applicable_accessibilities = * +dotnet_naming_symbols.sanity_check_uncovered_field_case_group.applicable_kinds = field +dotnet_naming_rule.sanity_check_uncovered_field_case_rule.symbols = sanity_check_uncovered_field_case_group +dotnet_naming_rule.sanity_check_uncovered_field_case_rule.style = internal_error_style +dotnet_naming_rule.sanity_check_uncovered_field_case_rule.severity = error + + +########################################## +# Other Naming Rules +########################################## + +# All of the following must be PascalCase: +# - Namespaces +# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-namespaces +# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1300.md +# - Classes and Enumerations +# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces +# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1300.md +# - Delegates +# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#names-of-common-types +# - Constructors, Properties, Events, Methods +# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-type-members +dotnet_naming_symbols.element_group.applicable_kinds = namespace, class, enum, struct, delegate, event, method, property +dotnet_naming_rule.element_rule.symbols = element_group +dotnet_naming_rule.element_rule.style = pascal_case_style +dotnet_naming_rule.element_rule.severity = warning + +# Interfaces use PascalCase and are prefixed with uppercase 'I' +# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces +dotnet_naming_symbols.interface_group.applicable_kinds = interface +dotnet_naming_rule.interface_rule.symbols = interface_group +dotnet_naming_rule.interface_rule.style = prefix_interface_with_i_style +dotnet_naming_rule.interface_rule.severity = warning + +# Generics Type Parameters use PascalCase and are prefixed with uppercase 'T' +# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces +dotnet_naming_symbols.type_parameter_group.applicable_kinds = type_parameter +dotnet_naming_rule.type_parameter_rule.symbols = type_parameter_group +dotnet_naming_rule.type_parameter_rule.style = prefix_type_parameters_with_t_style +dotnet_naming_rule.type_parameter_rule.severity = warning + +# Function parameters use camelCase +# https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-parameters +dotnet_naming_symbols.parameters_group.applicable_kinds = parameter +dotnet_naming_rule.parameters_rule.symbols = parameters_group +dotnet_naming_rule.parameters_rule.style = camel_case_style +dotnet_naming_rule.parameters_rule.severity = warning + +########################################## +# License +########################################## +# The following applies as to the .editorconfig file ONLY, and is +# included below for reference, per the requirements of the license +# corresponding to this .editorconfig file. +# See: https://github.com/RehanSaeed/EditorConfig +# +# MIT License +# +# Copyright (c) 2017-2019 Muhammad Rehan Saeed +# Copyright (c) 2019 Henry Gabryjelski +# +# Permission is hereby granted, free of charge, to any +# person obtaining a copy of this software and associated +# documentation files (the "Software"), to deal in the +# Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, +# sublicense, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject +# to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +########################################## diff --git a/Directory.Build.props b/Directory.Build.props index bb97810a8f..3a133efe7a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -10,133 +10,12 @@ that is done by the file that imports us. --> - - $(MSBuildThisFileDirectory)artifacts/ - $(SixLaborsProjectCategory)/$(MSBuildProjectName) - https://github.com/SixLabors/ImageSharp/ - $(MSBuildThisFileDirectory)/.runsettings + + $(MSBuildThisFileDirectory) - - - true - $(BaseArtifactsPath)obj/$(BaseArtifactsPathSuffix)/ - portable - full - disable - true - true - - - - - - $(DefineConstants);SUPPORTS_MATHF - $(DefineConstants);SUPPORTS_HASHCODE - $(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS - $(DefineConstants);SUPPORTS_SPAN_STREAM - $(DefineConstants);SUPPORTS_ENCODING_STRING - $(DefineConstants);SUPPORTS_RUNTIME_INTRINSICS - $(DefineConstants);SUPPORTS_CODECOVERAGE - $(DefineConstants);SUPPORTS_HOTPATH - $(DefineConstants);SUPPORTS_CREATESPAN - - - $(DefineConstants);SUPPORTS_MATHF - $(DefineConstants);SUPPORTS_HASHCODE - $(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS - $(DefineConstants);SUPPORTS_SPAN_STREAM - $(DefineConstants);SUPPORTS_ENCODING_STRING - $(DefineConstants);SUPPORTS_CODECOVERAGE - $(DefineConstants);SUPPORTS_CREATESPAN - - - $(DefineConstants);SUPPORTS_MATHF - $(DefineConstants);SUPPORTS_CODECOVERAGE - $(DefineConstants);SUPPORTS_CREATESPAN - - - $(DefineConstants);SUPPORTS_MATHF - $(DefineConstants);SUPPORTS_HASHCODE - $(DefineConstants);SUPPORTS_SPAN_STREAM - $(DefineConstants);SUPPORTS_ENCODING_STRING - $(DefineConstants);SUPPORTS_CODECOVERAGE - $(DefineConstants);SUPPORTS_CREATESPAN - - - $(DefineConstants);SUPPORTS_CODECOVERAGE - - - $(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS - $(DefineConstants);SUPPORTS_CODECOVERAGE - - - - - Six Labors and contributors - $(BaseArtifactsPath)bin/$(BaseArtifactsPathSuffix)/ - Six Labors - $(BaseArtifactsPath)pkg/$(BaseArtifactsPathSuffix)/$(Configuration)/ - SixLabors.ImageSharp - 0.0.1 - $(PackageVersion) - - - - - - v - normal - - - - - Copyright © Six Labors - strict;IOperation - true - 8.0 - en - true - sixlabors.imagesharp.128.png - Apache-2.0 - $(RepositoryUrl) - true - git - - https://www.myget.org/F/sixlabors/api/v3/index.json; - https://api.nuget.org/v3/index.json; - - https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json; - https://www.myget.org/F/coverlet-dev/api/v3/index.json; - - true - $(MSBuildThisFileDirectory)shared-infrastructure/SixLabors.snk - 00240000048000009400000006020000002400005253413100040000010001000147e6fe6766715eec6cfed61f1e7dcdbf69748a3e355c67e9d8dfd953acab1d5e012ba34b23308166fdc61ee1d0390d5f36d814a6091dd4b5ed9eda5a26afced924c683b4bfb4b3d64b0586a57eff9f02b1f84e3cb0ddd518bd1697f2c84dcbb97eb8bb5c7801be12112ed0ec86db934b0e9a5171e6bb1384b6d2f7d54dfa97 - true - - - - - - - - - - - + + diff --git a/Directory.Build.targets b/Directory.Build.targets index 2a7d25b977..9730219482 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -5,35 +5,12 @@ Directory.Build.targets is automatically picked up and imported by Microsoft.Common.targets. This file needs to exist, even if empty so that files in the parent directory tree, with the same name, are not imported - instead. The import fairly late and most other props/targets will have been + instead. They import fairly late and most other props/targets will have been imported beforehand. We also don't need to add ourselves to MSBuildAllProjects, as that is done by the file that imports us. --> - - - $(DefineConstants);$(OS) - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/ImageSharp.sln b/ImageSharp.sln index b1d3176ad2..8dfab6033c 100644 --- a/ImageSharp.sln +++ b/ImageSharp.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.28902.138 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C317F1B1-D75E-4C6D-83EB-80367343E0D7}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_root", "_root", "{C317F1B1-D75E-4C6D-83EB-80367343E0D7}" ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig .gitattributes = .gitattributes @@ -15,7 +15,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ci-test.ps1 = ci-test.ps1 Directory.Build.props = Directory.Build.props Directory.Build.targets = Directory.Build.targets - GitVersion.yml = GitVersion.yml LICENSE = LICENSE README.md = README.md EndProjectSection @@ -46,6 +45,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{56801022 ProjectSection(SolutionItems) = preProject tests\Directory.Build.props = tests\Directory.Build.props tests\Directory.Build.targets = tests\Directory.Build.targets + tests\ImageSharp.Tests.ruleset = tests\ImageSharp.Tests.ruleset EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Images", "Images", "{FA55F5DE-11A6-487D-ABA4-BC93A02717DD}" @@ -54,16 +54,23 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Input", "Input", "{9DA226A1 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Bmp", "Bmp", "{1A82C5F6-90E0-4E97-BE16-A825C046B493}" ProjectSection(SolutionItems) = preProject + tests\Images\Input\Bmp\9S.BMP = tests\Images\Input\Bmp\9S.BMP + tests\Images\Input\Bmp\ba-bm.bmp = tests\Images\Input\Bmp\ba-bm.bmp tests\Images\Input\Bmp\BitmapCoreHeaderQR.bmp = tests\Images\Input\Bmp\BitmapCoreHeaderQR.bmp tests\Images\Input\Bmp\BITMAPV5HEADER.bmp = tests\Images\Input\Bmp\BITMAPV5HEADER.bmp tests\Images\Input\Bmp\Car.bmp = tests\Images\Input\Bmp\Car.bmp + tests\Images\Input\Bmp\DIAMOND.BMP = tests\Images\Input\Bmp\DIAMOND.BMP tests\Images\Input\Bmp\F.bmp = tests\Images\Input\Bmp\F.bmp + tests\Images\Input\Bmp\GMARBLE.BMP = tests\Images\Input\Bmp\GMARBLE.BMP + tests\Images\Input\Bmp\invalidPaletteSize.bmp = tests\Images\Input\Bmp\invalidPaletteSize.bmp tests\Images\Input\Bmp\issue735.bmp = tests\Images\Input\Bmp\issue735.bmp tests\Images\Input\Bmp\neg_height.bmp = tests\Images\Input\Bmp\neg_height.bmp tests\Images\Input\Bmp\pal1.bmp = tests\Images\Input\Bmp\pal1.bmp tests\Images\Input\Bmp\pal1p1.bmp = tests\Images\Input\Bmp\pal1p1.bmp tests\Images\Input\Bmp\pal4.bmp = tests\Images\Input\Bmp\pal4.bmp tests\Images\Input\Bmp\pal4rle.bmp = tests\Images\Input\Bmp\pal4rle.bmp + tests\Images\Input\Bmp\pal4rlecut.bmp = tests\Images\Input\Bmp\pal4rlecut.bmp + tests\Images\Input\Bmp\pal4rletrns.bmp = tests\Images\Input\Bmp\pal4rletrns.bmp tests\Images\Input\Bmp\pal8-0.bmp = tests\Images\Input\Bmp\pal8-0.bmp tests\Images\Input\Bmp\pal8gs.bmp = tests\Images\Input\Bmp\pal8gs.bmp tests\Images\Input\Bmp\pal8offs.bmp = tests\Images\Input\Bmp\pal8offs.bmp @@ -71,26 +78,45 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Bmp", "Bmp", "{1A82C5F6-90E tests\Images\Input\Bmp\pal8os2v1_winv2.bmp = tests\Images\Input\Bmp\pal8os2v1_winv2.bmp tests\Images\Input\Bmp\pal8os2v2-16.bmp = tests\Images\Input\Bmp\pal8os2v2-16.bmp tests\Images\Input\Bmp\pal8os2v2.bmp = tests\Images\Input\Bmp\pal8os2v2.bmp + tests\Images\Input\Bmp\pal8oversizepal.bmp = tests\Images\Input\Bmp\pal8oversizepal.bmp + tests\Images\Input\Bmp\pal8rlecut.bmp = tests\Images\Input\Bmp\pal8rlecut.bmp + tests\Images\Input\Bmp\pal8rletrns.bmp = tests\Images\Input\Bmp\pal8rletrns.bmp tests\Images\Input\Bmp\pal8v4.bmp = tests\Images\Input\Bmp\pal8v4.bmp tests\Images\Input\Bmp\pal8v5.bmp = tests\Images\Input\Bmp\pal8v5.bmp + tests\Images\Input\Bmp\PINES.BMP = tests\Images\Input\Bmp\PINES.BMP tests\Images\Input\Bmp\rgb16-565.bmp = tests\Images\Input\Bmp\rgb16-565.bmp tests\Images\Input\Bmp\rgb16-565pal.bmp = tests\Images\Input\Bmp\rgb16-565pal.bmp tests\Images\Input\Bmp\rgb16.bmp = tests\Images\Input\Bmp\rgb16.bmp tests\Images\Input\Bmp\rgb16bfdef.bmp = tests\Images\Input\Bmp\rgb16bfdef.bmp tests\Images\Input\Bmp\rgb24.bmp = tests\Images\Input\Bmp\rgb24.bmp + tests\Images\Input\Bmp\rgb24jpeg.bmp = tests\Images\Input\Bmp\rgb24jpeg.bmp + tests\Images\Input\Bmp\rgb24largepal.bmp = tests\Images\Input\Bmp\rgb24largepal.bmp + tests\Images\Input\Bmp\rgb24png.bmp = tests\Images\Input\Bmp\rgb24png.bmp + tests\Images\Input\Bmp\rgb24rle24.bmp = tests\Images\Input\Bmp\rgb24rle24.bmp tests\Images\Input\Bmp\rgb32.bmp = tests\Images\Input\Bmp\rgb32.bmp tests\Images\Input\Bmp\rgb32bf.bmp = tests\Images\Input\Bmp\rgb32bf.bmp tests\Images\Input\Bmp\rgb32bfdef.bmp = tests\Images\Input\Bmp\rgb32bfdef.bmp + tests\Images\Input\Bmp\rgb32h52.bmp = tests\Images\Input\Bmp\rgb32h52.bmp tests\Images\Input\Bmp\rgba32-1010102.bmp = tests\Images\Input\Bmp\rgba32-1010102.bmp tests\Images\Input\Bmp\rgba32.bmp = tests\Images\Input\Bmp\rgba32.bmp tests\Images\Input\Bmp\rgba32abf.bmp = tests\Images\Input\Bmp\rgba32abf.bmp tests\Images\Input\Bmp\rgba32h56.bmp = tests\Images\Input\Bmp\rgba32h56.bmp + tests\Images\Input\Bmp\rgba32v4.bmp = tests\Images\Input\Bmp\rgba32v4.bmp + tests\Images\Input\Bmp\rle24rlecut.bmp = tests\Images\Input\Bmp\rle24rlecut.bmp + tests\Images\Input\Bmp\rle24rletrns.bmp = tests\Images\Input\Bmp\rle24rletrns.bmp + tests\Images\Input\Bmp\rle4-delta-320x240.bmp = tests\Images\Input\Bmp\rle4-delta-320x240.bmp + tests\Images\Input\Bmp\rle8-blank-160x120.bmp = tests\Images\Input\Bmp\rle8-blank-160x120.bmp + tests\Images\Input\Bmp\rle8-delta-320x240.bmp = tests\Images\Input\Bmp\rle8-delta-320x240.bmp tests\Images\Input\Bmp\RunLengthEncoded-inverted.bmp = tests\Images\Input\Bmp\RunLengthEncoded-inverted.bmp tests\Images\Input\Bmp\RunLengthEncoded.bmp = tests\Images\Input\Bmp\RunLengthEncoded.bmp + tests\Images\Input\Bmp\SKATER.BMP = tests\Images\Input\Bmp\SKATER.BMP + tests\Images\Input\Bmp\SPADE.BMP = tests\Images\Input\Bmp\SPADE.BMP + tests\Images\Input\Bmp\SUNFLOW.BMP = tests\Images\Input\Bmp\SUNFLOW.BMP tests\Images\Input\Bmp\test16-inverted.bmp = tests\Images\Input\Bmp\test16-inverted.bmp tests\Images\Input\Bmp\test16.bmp = tests\Images\Input\Bmp\test16.bmp tests\Images\Input\Bmp\test8-inverted.bmp = tests\Images\Input\Bmp\test8-inverted.bmp tests\Images\Input\Bmp\test8.bmp = tests\Images\Input\Bmp\test8.bmp + tests\Images\Input\Bmp\WARPD.BMP = tests\Images\Input\Bmp\WARPD.BMP EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Gif", "Gif", "{EE3FB0B3-1C31-41E9-93AB-BA800560A868}" @@ -99,8 +125,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Gif", "Gif", "{EE3FB0B3-1C3 tests\Images\Input\Gif\base_4x1.gif = tests\Images\Input\Gif\base_4x1.gif tests\Images\Input\Gif\cheers.gif = tests\Images\Input\Gif\cheers.gif tests\Images\Input\Gif\giphy.gif = tests\Images\Input\Gif\giphy.gif + tests\Images\Input\Gif\GlobalQuantizationTest.gif = tests\Images\Input\Gif\GlobalQuantizationTest.gif + tests\Images\Input\Gif\image-zero-height.gif = tests\Images\Input\Gif\image-zero-height.gif + tests\Images\Input\Gif\image-zero-size.gif = tests\Images\Input\Gif\image-zero-size.gif + tests\Images\Input\Gif\image-zero-width.gif = tests\Images\Input\Gif\image-zero-width.gif tests\Images\Input\Gif\kumin.gif = tests\Images\Input\Gif\kumin.gif + tests\Images\Input\Gif\large_comment.gif = tests\Images\Input\Gif\large_comment.gif tests\Images\Input\Gif\leo.gif = tests\Images\Input\Gif\leo.gif + tests\Images\Input\Gif\max-height.gif = tests\Images\Input\Gif\max-height.gif + tests\Images\Input\Gif\max-width.gif = tests\Images\Input\Gif\max-width.gif + tests\Images\Input\Gif\receipt.gif = tests\Images\Input\Gif\receipt.gif tests\Images\Input\Gif\rings.gif = tests\Images\Input\Gif\rings.gif tests\Images\Input\Gif\trans.gif = tests\Images\Input\Gif\trans.gif EndProjectSection @@ -116,6 +150,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Jpg", "Jpg", "{DB21FED7-E8C EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "baseline", "baseline", "{195BA3D3-3E9F-4BC5-AB40-5F9FEB638146}" ProjectSection(SolutionItems) = preProject + tests\Images\Input\Jpg\baseline\640px-Unequalized_Hawkes_Bay_NZ.jpg = tests\Images\Input\Jpg\baseline\640px-Unequalized_Hawkes_Bay_NZ.jpg tests\Images\Input\Jpg\baseline\AsianCarvingLowContrast.jpg = tests\Images\Input\Jpg\baseline\AsianCarvingLowContrast.jpg tests\Images\Input\Jpg\baseline\badeof.jpg = tests\Images\Input\Jpg\baseline\badeof.jpg tests\Images\Input\Jpg\baseline\badrst.jpg = tests\Images\Input\Jpg\baseline\badrst.jpg @@ -125,6 +160,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "baseline", "baseline", "{19 tests\Images\Input\Jpg\baseline\Floorplan.jpg = tests\Images\Input\Jpg\baseline\Floorplan.jpg tests\Images\Input\Jpg\baseline\gamma_dalai_lama_gray.jpg = tests\Images\Input\Jpg\baseline\gamma_dalai_lama_gray.jpg tests\Images\Input\Jpg\baseline\Hiyamugi.jpg = tests\Images\Input\Jpg\baseline\Hiyamugi.jpg + tests\Images\Input\Jpg\baseline\iptc-psAPP13-wIPTCempty.jpg = tests\Images\Input\Jpg\baseline\iptc-psAPP13-wIPTCempty.jpg + tests\Images\Input\Jpg\baseline\iptc.jpg = tests\Images\Input\Jpg\baseline\iptc.jpg tests\Images\Input\Jpg\baseline\jpeg400jfif.jpg = tests\Images\Input\Jpg\baseline\jpeg400jfif.jpg tests\Images\Input\Jpg\baseline\jpeg420exif.jpg = tests\Images\Input\Jpg\baseline\jpeg420exif.jpg tests\Images\Input\Jpg\baseline\jpeg420small.jpg = tests\Images\Input\Jpg\baseline\jpeg420small.jpg @@ -167,6 +204,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "JpegSnoopReports", "JpegSno EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "issues", "issues", "{5C9B689F-B96D-47BE-A208-C23B1B2A8570}" ProjectSection(SolutionItems) = preProject + tests\Images\Input\Jpg\issues\issue-1076-invalid-subsampling.jpg = tests\Images\Input\Jpg\issues\issue-1076-invalid-subsampling.jpg + tests\Images\Input\Jpg\issues\issue-1221-identify-multi-frame.jpg = tests\Images\Input\Jpg\issues\issue-1221-identify-multi-frame.jpg + tests\Images\Input\Jpg\issues\issue1006-incorrect-resize.jpg = tests\Images\Input\Jpg\issues\issue1006-incorrect-resize.jpg + tests\Images\Input\Jpg\issues\issue1049-exif-resize.jpg = tests\Images\Input\Jpg\issues\issue1049-exif-resize.jpg tests\Images\Input\Jpg\issues\Issue159-MissingFF00-Progressive-Bedroom.jpg = tests\Images\Input\Jpg\issues\Issue159-MissingFF00-Progressive-Bedroom.jpg tests\Images\Input\Jpg\issues\Issue159-MissingFF00-Progressive-Girl.jpg = tests\Images\Input\Jpg\issues\Issue159-MissingFF00-Progressive-Girl.jpg tests\Images\Input\Jpg\issues\Issue178-BadCoeffsProgressive-Lemon.jpg = tests\Images\Input\Jpg\issues\Issue178-BadCoeffsProgressive-Lemon.jpg @@ -214,6 +255,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fuzz", "fuzz", "{516A3532-6 tests\Images\Input\Jpg\issues\fuzz\Issue826-ArgumentException-C.jpg = tests\Images\Input\Jpg\issues\fuzz\Issue826-ArgumentException-C.jpg tests\Images\Input\Jpg\issues\fuzz\Issue827-AccessViolationException.jpg = tests\Images\Input\Jpg\issues\fuzz\Issue827-AccessViolationException.jpg tests\Images\Input\Jpg\issues\fuzz\Issue839-ExecutionEngineException.jpg = tests\Images\Input\Jpg\issues\fuzz\Issue839-ExecutionEngineException.jpg + tests\Images\Input\Jpg\issues\fuzz\Issue922-AccessViolationException.jpg = tests\Images\Input\Jpg\issues\fuzz\Issue922-AccessViolationException.jpg EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "JpegSnoopReports", "JpegSnoopReports", "{714CDEA1-9AE6-4F76-B8B1-A7DB8C1DB82F}" @@ -261,16 +303,24 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Png", "Png", "{E1C42A6F-913 ProjectSection(SolutionItems) = preProject tests\Images\Input\Png\banner7-adam.png = tests\Images\Input\Png\banner7-adam.png tests\Images\Input\Png\banner8-index.png = tests\Images\Input\Png\banner8-index.png + tests\Images\Input\Png\basn3p01.png = tests\Images\Input\Png\basn3p01.png + tests\Images\Input\Png\basn3p02.png = tests\Images\Input\Png\basn3p02.png + tests\Images\Input\Png\basn3p04.png = tests\Images\Input\Png\basn3p04.png + tests\Images\Input\Png\basn3p08.png = tests\Images\Input\Png\basn3p08.png tests\Images\Input\Png\big-corrupted-chunk.png = tests\Images\Input\Png\big-corrupted-chunk.png + tests\Images\Input\Png\bike-small.png = tests\Images\Input\Png\bike-small.png tests\Images\Input\Png\Bike.png = tests\Images\Input\Png\Bike.png tests\Images\Input\Png\BikeGrayscale.png = tests\Images\Input\Png\BikeGrayscale.png tests\Images\Input\Png\blur.png = tests\Images\Input\Png\blur.png tests\Images\Input\Png\bpp1.png = tests\Images\Input\Png\bpp1.png + tests\Images\Input\Png\Bradley01.png = tests\Images\Input\Png\Bradley01.png + tests\Images\Input\Png\Bradley02.png = tests\Images\Input\Png\Bradley02.png tests\Images\Input\Png\CalliphoraPartial.png = tests\Images\Input\Png\CalliphoraPartial.png tests\Images\Input\Png\CalliphoraPartialGrayscale.png = tests\Images\Input\Png\CalliphoraPartialGrayscale.png tests\Images\Input\Png\chunklength1.png = tests\Images\Input\Png\chunklength1.png tests\Images\Input\Png\chunklength2.png = tests\Images\Input\Png\chunklength2.png tests\Images\Input\Png\cross.png = tests\Images\Input\Png\cross.png + tests\Images\Input\Png\david.png = tests\Images\Input\Png\david.png tests\Images\Input\Png\ducky.png = tests\Images\Input\Png\ducky.png tests\Images\Input\Png\filter0.png = tests\Images\Input\Png\filter0.png tests\Images\Input\Png\filter1.png = tests\Images\Input\Png\filter1.png @@ -293,6 +343,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Png", "Png", "{E1C42A6F-913 tests\Images\Input\Png\iftbbn0g04.png = tests\Images\Input\Png\iftbbn0g04.png tests\Images\Input\Png\indexed.png = tests\Images\Input\Png\indexed.png tests\Images\Input\Png\interlaced.png = tests\Images\Input\Png\interlaced.png + tests\Images\Input\Png\InvalidTextData.png = tests\Images\Input\Png\InvalidTextData.png tests\Images\Input\Png\kaboom.png = tests\Images\Input\Png\kaboom.png tests\Images\Input\Png\low-variance.png = tests\Images\Input\Png\low-variance.png tests\Images\Input\Png\palette-8bpp.png = tests\Images\Input\Png\palette-8bpp.png @@ -300,6 +351,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Png", "Png", "{E1C42A6F-913 tests\Images\Input\Png\pd-source.png = tests\Images\Input\Png\pd-source.png tests\Images\Input\Png\pd.png = tests\Images\Input\Png\pd.png tests\Images\Input\Png\pl.png = tests\Images\Input\Png\pl.png + tests\Images\Input\Png\PngWithMetaData.png = tests\Images\Input\Png\PngWithMetaData.png tests\Images\Input\Png\pp.png = tests\Images\Input\Png\pp.png tests\Images\Input\Png\rainbow.png = tests\Images\Input\Png\rainbow.png tests\Images\Input\Png\ratio-1x4.png = tests\Images\Input\Png\ratio-1x4.png @@ -317,7 +369,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Png", "Png", "{E1C42A6F-913 tests\Images\Input\Png\versioning-1_2.png = tests\Images\Input\Png\versioning-1_2.png tests\Images\Input\Png\vim16x16_1.png = tests\Images\Input\Png\vim16x16_1.png tests\Images\Input\Png\vim16x16_2.png = tests\Images\Input\Png\vim16x16_2.png + tests\Images\Input\Png\xc1n0g08.png = tests\Images\Input\Png\xc1n0g08.png + tests\Images\Input\Png\xc9n2c08.png = tests\Images\Input\Png\xc9n2c08.png + tests\Images\Input\Png\xd0n2c08.png = tests\Images\Input\Png\xd0n2c08.png + tests\Images\Input\Png\xd3n2c08.png = tests\Images\Input\Png\xd3n2c08.png + tests\Images\Input\Png\xdtn0g01.png = tests\Images\Input\Png\xdtn0g01.png tests\Images\Input\Png\zlib-overflow.png = tests\Images\Input\Png\zlib-overflow.png + tests\Images\Input\Png\zlib-overflow2.png = tests\Images\Input\Png\zlib-overflow2.png + tests\Images\Input\Png\zlib-ztxt-bad-header.png = tests\Images\Input\Png\zlib-ztxt-bad-header.png EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Tests", "tests\ImageSharp.Tests\ImageSharp.Tests.csproj", "{EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}" @@ -333,6 +392,87 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SharedInfrastructure", "sha EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Tests.ProfilingSandbox", "tests\ImageSharp.Tests.ProfilingSandbox\ImageSharp.Tests.ProfilingSandbox.csproj", "{FC527290-2F22-432C-B77B-6E815726B02C}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "issues", "issues", "{670DD46C-82E9-499A-B2D2-00A802ED0141}" + ProjectSection(SolutionItems) = preProject + tests\Images\Input\Png\issues\Issue_1014_1.png = tests\Images\Input\Png\issues\Issue_1014_1.png + tests\Images\Input\Png\issues\Issue_1014_2.png = tests\Images\Input\Png\issues\Issue_1014_2.png + tests\Images\Input\Png\issues\Issue_1014_3.png = tests\Images\Input\Png\issues\Issue_1014_3.png + tests\Images\Input\Png\issues\Issue_1014_4.png = tests\Images\Input\Png\issues\Issue_1014_4.png + tests\Images\Input\Png\issues\Issue_1014_5.png = tests\Images\Input\Png\issues\Issue_1014_5.png + tests\Images\Input\Png\issues\Issue_1014_6.png = tests\Images\Input\Png\issues\Issue_1014_6.png + tests\Images\Input\Png\issues\Issue_1047.png = tests\Images\Input\Png\issues\Issue_1047.png + tests\Images\Input\Png\issues\Issue_1127.png = tests\Images\Input\Png\issues\Issue_1127.png + tests\Images\Input\Png\issues\Issue_1177_1.png = tests\Images\Input\Png\issues\Issue_1177_1.png + tests\Images\Input\Png\issues\Issue_1177_2.png = tests\Images\Input\Png\issues\Issue_1177_2.png + tests\Images\Input\Png\issues\Issue_410.png = tests\Images\Input\Png\issues\Issue_410.png + tests\Images\Input\Png\issues\Issue_935.png = tests\Images\Input\Png\issues\Issue_935.png + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tga", "Tga", "{5DFC394F-136F-4B76-9BCA-3BA786515EFC}" + ProjectSection(SolutionItems) = preProject + tests\Images\Input\Tga\16bit_noalphabits.tga = tests\Images\Input\Tga\16bit_noalphabits.tga + tests\Images\Input\Tga\16bit_rle_noalphabits.tga = tests\Images\Input\Tga\16bit_rle_noalphabits.tga + tests\Images\Input\Tga\32bit_no_alphabits.tga = tests\Images\Input\Tga\32bit_no_alphabits.tga + tests\Images\Input\Tga\32bit_rle_no_alphabits.tga = tests\Images\Input\Tga\32bit_rle_no_alphabits.tga + tests\Images\Input\Tga\ccm8.tga = tests\Images\Input\Tga\ccm8.tga + tests\Images\Input\Tga\grayscale_a_LL.tga = tests\Images\Input\Tga\grayscale_a_LL.tga + tests\Images\Input\Tga\grayscale_a_LR.tga = tests\Images\Input\Tga\grayscale_a_LR.tga + tests\Images\Input\Tga\grayscale_a_rle_LL.tga = tests\Images\Input\Tga\grayscale_a_rle_LL.tga + tests\Images\Input\Tga\grayscale_a_rle_LR.tga = tests\Images\Input\Tga\grayscale_a_rle_LR.tga + tests\Images\Input\Tga\grayscale_a_rle_UL.tga = tests\Images\Input\Tga\grayscale_a_rle_UL.tga + tests\Images\Input\Tga\grayscale_a_rle_UR.tga = tests\Images\Input\Tga\grayscale_a_rle_UR.tga + tests\Images\Input\Tga\grayscale_a_UL.tga = tests\Images\Input\Tga\grayscale_a_UL.tga + tests\Images\Input\Tga\grayscale_a_UR.tga = tests\Images\Input\Tga\grayscale_a_UR.tga + tests\Images\Input\Tga\grayscale_LL.tga = tests\Images\Input\Tga\grayscale_LL.tga + tests\Images\Input\Tga\grayscale_LR.tga = tests\Images\Input\Tga\grayscale_LR.tga + tests\Images\Input\Tga\grayscale_rle_LR.tga = tests\Images\Input\Tga\grayscale_rle_LR.tga + tests\Images\Input\Tga\grayscale_rle_UL.tga = tests\Images\Input\Tga\grayscale_rle_UL.tga + tests\Images\Input\Tga\grayscale_rle_UR.tga = tests\Images\Input\Tga\grayscale_rle_UR.tga + tests\Images\Input\Tga\grayscale_UL.tga = tests\Images\Input\Tga\grayscale_UL.tga + tests\Images\Input\Tga\grayscale_UR.tga = tests\Images\Input\Tga\grayscale_UR.tga + tests\Images\Input\Tga\indexed_a_LL.tga = tests\Images\Input\Tga\indexed_a_LL.tga + tests\Images\Input\Tga\indexed_a_LR.tga = tests\Images\Input\Tga\indexed_a_LR.tga + tests\Images\Input\Tga\indexed_a_rle_LL.tga = tests\Images\Input\Tga\indexed_a_rle_LL.tga + tests\Images\Input\Tga\indexed_a_rle_LR.tga = tests\Images\Input\Tga\indexed_a_rle_LR.tga + tests\Images\Input\Tga\indexed_a_rle_UL.tga = tests\Images\Input\Tga\indexed_a_rle_UL.tga + tests\Images\Input\Tga\indexed_a_rle_UR.tga = tests\Images\Input\Tga\indexed_a_rle_UR.tga + tests\Images\Input\Tga\indexed_a_UL.tga = tests\Images\Input\Tga\indexed_a_UL.tga + tests\Images\Input\Tga\indexed_a_UR.tga = tests\Images\Input\Tga\indexed_a_UR.tga + tests\Images\Input\Tga\indexed_LR.tga = tests\Images\Input\Tga\indexed_LR.tga + tests\Images\Input\Tga\indexed_rle_LL.tga = tests\Images\Input\Tga\indexed_rle_LL.tga + tests\Images\Input\Tga\indexed_rle_LR.tga = tests\Images\Input\Tga\indexed_rle_LR.tga + tests\Images\Input\Tga\indexed_rle_UL.tga = tests\Images\Input\Tga\indexed_rle_UL.tga + tests\Images\Input\Tga\indexed_rle_UR.tga = tests\Images\Input\Tga\indexed_rle_UR.tga + tests\Images\Input\Tga\indexed_UL.tga = tests\Images\Input\Tga\indexed_UL.tga + tests\Images\Input\Tga\indexed_UR.tga = tests\Images\Input\Tga\indexed_UR.tga + tests\Images\Input\Tga\rgb15.tga = tests\Images\Input\Tga\rgb15.tga + tests\Images\Input\Tga\rgb15rle.tga = tests\Images\Input\Tga\rgb15rle.tga + tests\Images\Input\Tga\rgb24_top_left.tga = tests\Images\Input\Tga\rgb24_top_left.tga + tests\Images\Input\Tga\rgb_a_LL.tga = tests\Images\Input\Tga\rgb_a_LL.tga + tests\Images\Input\Tga\rgb_a_LR.tga = tests\Images\Input\Tga\rgb_a_LR.tga + tests\Images\Input\Tga\rgb_a_rle_LR.tga = tests\Images\Input\Tga\rgb_a_rle_LR.tga + tests\Images\Input\Tga\rgb_a_rle_UL.tga = tests\Images\Input\Tga\rgb_a_rle_UL.tga + tests\Images\Input\Tga\rgb_a_rle_UR.tga = tests\Images\Input\Tga\rgb_a_rle_UR.tga + tests\Images\Input\Tga\rgb_a_UL.tga = tests\Images\Input\Tga\rgb_a_UL.tga + tests\Images\Input\Tga\rgb_a_UR.tga = tests\Images\Input\Tga\rgb_a_UR.tga + tests\Images\Input\Tga\rgb_LR.tga = tests\Images\Input\Tga\rgb_LR.tga + tests\Images\Input\Tga\rgb_rle_LR.tga = tests\Images\Input\Tga\rgb_rle_LR.tga + tests\Images\Input\Tga\rgb_rle_UR.tga = tests\Images\Input\Tga\rgb_rle_UR.tga + tests\Images\Input\Tga\rgb_UR.tga = tests\Images\Input\Tga\rgb_UR.tga + tests\Images\Input\Tga\targa_16bit.tga = tests\Images\Input\Tga\targa_16bit.tga + tests\Images\Input\Tga\targa_16bit_pal.tga = tests\Images\Input\Tga\targa_16bit_pal.tga + tests\Images\Input\Tga\targa_16bit_rle.tga = tests\Images\Input\Tga\targa_16bit_rle.tga + tests\Images\Input\Tga\targa_24bit.tga = tests\Images\Input\Tga\targa_24bit.tga + tests\Images\Input\Tga\targa_24bit_pal.tga = tests\Images\Input\Tga\targa_24bit_pal.tga + tests\Images\Input\Tga\targa_24bit_pal_origin_topleft.tga = tests\Images\Input\Tga\targa_24bit_pal_origin_topleft.tga + tests\Images\Input\Tga\targa_24bit_rle.tga = tests\Images\Input\Tga\targa_24bit_rle.tga + tests\Images\Input\Tga\targa_24bit_rle_origin_topleft.tga = tests\Images\Input\Tga\targa_24bit_rle_origin_topleft.tga + tests\Images\Input\Tga\targa_32bit.tga = tests\Images\Input\Tga\targa_32bit.tga + tests\Images\Input\Tga\targa_32bit_rle.tga = tests\Images\Input\Tga\targa_32bit_rle.tga + tests\Images\Input\Tga\targa_8bit.tga = tests\Images\Input\Tga\targa_8bit.tga + tests\Images\Input\Tga\targa_8bit_rle.tga = tests\Images\Input\Tga\targa_8bit_rle.tga + EndProjectSection +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution shared-infrastructure\src\SharedInfrastructure\SharedInfrastructure.projitems*{2aa31a1f-142c-43f4-8687-09abca4b3a26}*SharedItemsImports = 5 @@ -400,6 +540,7 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution + {1799C43E-5C54-4A8F-8D64-B1475241DB0D} = {C317F1B1-D75E-4C6D-83EB-80367343E0D7} {FBE8C1AD-5AEC-4514-9B64-091D8E145865} = {1799C43E-5C54-4A8F-8D64-B1475241DB0D} {2AA31A1F-142C-43F4-8687-09ABCA4B3A26} = {815C0625-CD3D-440F-9F80-2D83856AB7AE} {FA55F5DE-11A6-487D-ABA4-BC93A02717DD} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC} @@ -421,6 +562,8 @@ Global {C0D7754B-5277-438E-ABEB-2BA34401B5A7} = {1799C43E-5C54-4A8F-8D64-B1475241DB0D} {68A8CC40-6AED-4E96-B524-31B1158FDEEA} = {815C0625-CD3D-440F-9F80-2D83856AB7AE} {FC527290-2F22-432C-B77B-6E815726B02C} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC} + {670DD46C-82E9-499A-B2D2-00A802ED0141} = {E1C42A6F-913B-4A7B-B1A8-2BB62843B254} + {5DFC394F-136F-4B76-9BCA-3BA786515EFC} = {9DA226A1-8656-49A8-A58A-A8B5C081AD66} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {5F8B9D1F-CD8B-4CC5-8216-D531E25BD795} diff --git a/shared-infrastructure b/shared-infrastructure index b0d4cd9864..2306bb8209 160000 --- a/shared-infrastructure +++ b/shared-infrastructure @@ -1 +1 @@ -Subproject commit b0d4cd98647996265a668e852574d901b27f22d6 +Subproject commit 2306bb8209f7c1f2eb9e2ba089b6f2fb87442380 diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 650f30fe1c..d211992a94 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -5,40 +5,22 @@ Directory.Build.props is automatically picked up and imported by Microsoft.Common.props. This file needs to exist, even if empty so that files in the parent directory tree, with the same name, are not imported - instead. The import fairly early and only Sdk.props will have been + instead. They import fairly early and only Sdk.props will have been imported beforehand. We also don't need to add ourselves to MSBuildAllProjects, as that is done by the file that imports us. --> - - $(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.props - src - + + + - - $(MSBuildThisFileDirectory)..\shared-infrastructure\SixLabors.ruleset - true - - + true - - - true - true - - - - true - - true - snupkg - - @@ -47,6 +29,4 @@ - - diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 9b8be05b56..c15c2a90cc 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -5,91 +5,15 @@ Directory.Build.targets is automatically picked up and imported by Microsoft.Common.targets. This file needs to exist, even if empty so that files in the parent directory tree, with the same name, are not imported - instead. The import fairly late and most other props/targets will have + instead. They import fairly late and most other props/targets will have been imported beforehand. We also don't need to add ourselves to MSBuildAllProjects, as that is done by the file that imports us. --> - - $(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.targets - + + + - - $(IntermediateOutputPath)$(MSBuildProjectName).InternalsVisibleTo$(DefaultLanguageSourceExtension) - - - - - $([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)')) - - - - - - - - - - - <_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/> - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ImageSharp/ImageSharp.csproj b/src/ImageSharp/ImageSharp.csproj index f4e9851986..84e4bc199a 100644 --- a/src/ImageSharp/ImageSharp.csproj +++ b/src/ImageSharp/ImageSharp.csproj @@ -4,41 +4,36 @@ SixLabors.ImageSharp SixLabors.ImageSharp - A cross-platform library for the processing of image files; written in C# - en - - $(packageversion) - 0.0.1 - - netcoreapp3.1;netcoreapp2.1;netstandard2.1;netstandard2.0;netstandard1.3;net472 - - true - true - SixLabors.ImageSharp - Image Resize Crop Gif Jpg Jpeg Bitmap Png Core SixLabors.ImageSharp + SixLabors.ImageSharp + sixlabors.imagesharp.128.png + Apache-2.0 + https://github.com/SixLabors/ImageSharp/ + $(RepositoryUrl) + Image Resize Crop Gif Jpg Jpeg Bitmap Png Tga NetCore + A new, fully featured, fully managed, cross-platform, 2D graphics API + netcoreapp3.1;netcoreapp2.1;netstandard2.1;netstandard2.0;netstandard1.3;net472 - - + - + - - - + + + - - - - + + + + diff --git a/src/ImageSharp/Metadata/Profiles/Exif/DC-008-Translation-2019-E.pdf b/src/ImageSharp/Metadata/Profiles/Exif/DC-008-Translation-2019-E.pdf deleted file mode 100644 index 9be0c8402b..0000000000 Binary files a/src/ImageSharp/Metadata/Profiles/Exif/DC-008-Translation-2019-E.pdf and /dev/null differ diff --git a/src/ImageSharp/Metadata/Profiles/Exif/DC-X008-Translation-2019-E.pdf b/src/ImageSharp/Metadata/Profiles/Exif/DC-X008-Translation-2019-E.pdf new file mode 100644 index 0000000000..cd7141fc8d Binary files /dev/null and b/src/ImageSharp/Metadata/Profiles/Exif/DC-X008-Translation-2019-E.pdf differ diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 23a69362b0..ac5b635962 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -5,34 +5,20 @@ Directory.Build.props is automatically picked up and imported by Microsoft.Common.props. This file needs to exist, even if empty so that files in the parent directory tree, with the same name, are not imported - instead. The import fairly early and only Sdk.props will have been + instead. They import fairly early and only Sdk.props will have been imported beforehand. We also don't need to add ourselves to MSBuildAllProjects, as that is done by the file that imports us. --> - - $(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.props - tests - false - - - - $(MSBuildThisFileDirectory)..\shared-infrastructure\SixLabors.Tests.ruleset - - $(NoWarn);CS0618 - + + + - - - - - - - - - + + ..\ImageSharp.Tests.ruleset + diff --git a/tests/Directory.Build.targets b/tests/Directory.Build.targets index 76759948b2..9495b912b6 100644 --- a/tests/Directory.Build.targets +++ b/tests/Directory.Build.targets @@ -5,42 +5,30 @@ Directory.Build.targets is automatically picked up and imported by Microsoft.Common.targets. This file needs to exist, even if empty so that files in the parent directory tree, with the same name, are not imported - instead. The import fairly late and most other props/targets will have + instead. They import fairly late and most other props/targets will have been imported beforehand. We also don't need to add ourselves to MSBuildAllProjects, as that is done by the file that imports us. --> - - $(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.targets - + + + - - - - - - - - + - + - - - - + - - diff --git a/tests/ImageSharp.Benchmarks/Codecs/Jpeg/DecodeJpeg_ImageSpecific.cs b/tests/ImageSharp.Benchmarks/Codecs/Jpeg/DecodeJpeg_ImageSpecific.cs index 4b1ee81a4c..65866e8ba1 100644 --- a/tests/ImageSharp.Benchmarks/Codecs/Jpeg/DecodeJpeg_ImageSpecific.cs +++ b/tests/ImageSharp.Benchmarks/Codecs/Jpeg/DecodeJpeg_ImageSpecific.cs @@ -25,18 +25,14 @@ public class DecodeJpeg_ImageSpecific { public class Config : ManualConfig { - public Config() - { - this.Add(MemoryDiagnoser.Default); - } + public Config() => this.AddDiagnoser(MemoryDiagnoser.Default); public class ShortClr : Benchmarks.Config { - public ShortClr() - { + public ShortClr() => + // Job.Default.With(ClrRuntime.Net472).WithLaunchCount(1).WithWarmupCount(2).WithIterationCount(3), - this.Add(Job.Default.With(CoreRuntime.Core31).WithLaunchCount(1).WithWarmupCount(2).WithIterationCount(3)); - } + this.AddJob(Job.Default.WithRuntime(CoreRuntime.Core31).WithLaunchCount(1).WithWarmupCount(2).WithIterationCount(3)); } } diff --git a/tests/ImageSharp.Benchmarks/Codecs/MultiImageBenchmarkBase.cs b/tests/ImageSharp.Benchmarks/Codecs/MultiImageBenchmarkBase.cs index 96fb2f4e6b..c2f6eab3c5 100644 --- a/tests/ImageSharp.Benchmarks/Codecs/MultiImageBenchmarkBase.cs +++ b/tests/ImageSharp.Benchmarks/Codecs/MultiImageBenchmarkBase.cs @@ -1,49 +1,40 @@ // Copyright (c) Six Labors. // Licensed under the Apache License, Version 2.0. +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Numerics; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Diagnosers; +using BenchmarkDotNet.Environments; using BenchmarkDotNet.Jobs; - using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Tests; +using CoreImage = SixLabors.ImageSharp.Image; namespace SixLabors.ImageSharp.Benchmarks.Codecs { - using System; - using System.Collections.Generic; - using System.Drawing; - using System.IO; - using System.Linq; - using System.Numerics; - - using BenchmarkDotNet.Attributes; - using BenchmarkDotNet.Diagnosers; - using BenchmarkDotNet.Environments; - using SixLabors.ImageSharp.Tests; - - using CoreImage = SixLabors.ImageSharp.Image; - public abstract class MultiImageBenchmarkBase { public class Config : ManualConfig { - public Config() - { - // Uncomment if you want to use any of the diagnoser - this.Add(MemoryDiagnoser.Default); - } + public Config() => this.AddDiagnoser(MemoryDiagnoser.Default); public class ShortClr : Benchmarks.Config { - public ShortClr() - { - this.Add(Job.Default.With(CoreRuntime.Core21).WithLaunchCount(1).WithWarmupCount(1).WithIterationCount(2)); - } + public ShortClr() => this.AddJob(Job.Default.WithRuntime(CoreRuntime.Core21).WithLaunchCount(1).WithWarmupCount(1).WithIterationCount(2)); } } - protected Dictionary fileNamesToBytes = new Dictionary(); - protected Dictionary> fileNamesToImageSharpImages = new Dictionary>(); - protected Dictionary fileNamesToSystemDrawingImages = new Dictionary(); + protected Dictionary FileNamesToBytes { get; set; } = new Dictionary(); + + protected Dictionary> FileNamesToImageSharpImages { get; set; } = new Dictionary>(); + + protected Dictionary FileNamesToSystemDrawingImages { get; set; } = new Dictionary(); /// /// The values of this enum separate input files into categories. @@ -109,7 +100,7 @@ protected IEnumerable> EnumeratePairsByBenchmarkSettings protected IEnumerable> FileNames2Bytes => this.EnumeratePairsByBenchmarkSettings( - this.fileNamesToBytes, + this.FileNamesToBytes, arr => arr.Length < this.LargeImageThresholdInBytes); protected abstract IEnumerable InputImageSubfoldersOrFiles { get; } @@ -132,7 +123,7 @@ protected virtual void ReadFilesImpl() { if (File.Exists(path)) { - this.fileNamesToBytes[path] = File.ReadAllBytes(path); + this.FileNamesToBytes[path] = File.ReadAllBytes(path); continue; } @@ -146,7 +137,7 @@ protected virtual void ReadFilesImpl() foreach (string fn in allFiles) { - this.fileNamesToBytes[fn] = File.ReadAllBytes(fn); + this.FileNamesToBytes[fn] = File.ReadAllBytes(fn); } } } @@ -180,30 +171,30 @@ protected override void ReadFilesImpl() { base.ReadFilesImpl(); - foreach (KeyValuePair kv in this.fileNamesToBytes) + foreach (KeyValuePair kv in this.FileNamesToBytes) { byte[] bytes = kv.Value; string fn = kv.Key; using (var ms1 = new MemoryStream(bytes)) { - this.fileNamesToImageSharpImages[fn] = CoreImage.Load(ms1); + this.FileNamesToImageSharpImages[fn] = CoreImage.Load(ms1); } - this.fileNamesToSystemDrawingImages[fn] = new Bitmap(new MemoryStream(bytes)); + this.FileNamesToSystemDrawingImages[fn] = new Bitmap(new MemoryStream(bytes)); } } protected IEnumerable>> FileNames2ImageSharpImages => this.EnumeratePairsByBenchmarkSettings( - this.fileNamesToImageSharpImages, + this.FileNamesToImageSharpImages, img => img.Width * img.Height < this.LargeImageThresholdInPixels); protected IEnumerable> FileNames2SystemDrawingImages => this.EnumeratePairsByBenchmarkSettings( - this.fileNamesToSystemDrawingImages, + this.FileNamesToSystemDrawingImages, img => img.Width * img.Height < this.LargeImageThresholdInPixels); protected virtual int LargeImageThresholdInPixels => 700000; diff --git a/tests/ImageSharp.Benchmarks/Config.cs b/tests/ImageSharp.Benchmarks/Config.cs index 53271f522d..4c9f6c06db 100644 --- a/tests/ImageSharp.Benchmarks/Config.cs +++ b/tests/ImageSharp.Benchmarks/Config.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors. // Licensed under the Apache License, Version 2.0. -#if Windows_NT +#if OS_WINDOWS using System.Security.Principal; using BenchmarkDotNet.Diagnostics.Windows; #endif @@ -16,12 +16,12 @@ public partial class Config : ManualConfig { public Config() { - this.Add(MemoryDiagnoser.Default); + this.AddDiagnoser(MemoryDiagnoser.Default); -#if Windows_NT +#if OS_WINDOWS if (this.IsElevated) { - this.Add(new NativeMemoryProfiler()); + this.AddDiagnoser(new NativeMemoryProfiler()); } #endif @@ -29,31 +29,20 @@ public Config() public class ShortClr : Config { - public ShortClr() - { - this.Add( - Job.Default.With(ClrRuntime.Net472).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3), - Job.Default.With(CoreRuntime.Core31).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3), - Job.Default.With(CoreRuntime.Core21).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3)); - } + public ShortClr() => this.AddJob( + Job.Default.WithRuntime(ClrRuntime.Net472).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3), + Job.Default.WithRuntime(CoreRuntime.Core31).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3), + Job.Default.WithRuntime(CoreRuntime.Core21).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3)); } public class ShortCore31 : Config { public ShortCore31() - { - this.Add(Job.Default.With(CoreRuntime.Core31).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3)); - } + => this.AddJob(Job.Default.WithRuntime(CoreRuntime.Core31).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3)); } -#if Windows_NT - private bool IsElevated - { - get - { - return new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator); - } - } +#if OS_WINDOWS + private bool IsElevated => new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator); #endif } } diff --git a/tests/ImageSharp.Tests.ProfilingSandbox/ImageSharp.Tests.ProfilingSandbox.csproj b/tests/ImageSharp.Tests.ProfilingSandbox/ImageSharp.Tests.ProfilingSandbox.csproj index 7c80316930..b71b5ebf2f 100644 --- a/tests/ImageSharp.Tests.ProfilingSandbox/ImageSharp.Tests.ProfilingSandbox.csproj +++ b/tests/ImageSharp.Tests.ProfilingSandbox/ImageSharp.Tests.ProfilingSandbox.csproj @@ -12,6 +12,7 @@ SixLabors.ImageSharp.Tests.ProfilingSandbox.Program false + false diff --git a/tests/ImageSharp.Tests.ruleset b/tests/ImageSharp.Tests.ruleset new file mode 100644 index 0000000000..e20fea985e --- /dev/null +++ b/tests/ImageSharp.Tests.ruleset @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/tests/ImageSharp.Tests/FileTestBase.cs b/tests/ImageSharp.Tests/FileTestBase.cs deleted file mode 100644 index 93024197b3..0000000000 --- a/tests/ImageSharp.Tests/FileTestBase.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Six Labors. -// Licensed under the Apache License, Version 2.0. - -using System; -using System.Collections.Generic; - -namespace SixLabors.ImageSharp.Tests -{ - /// - /// The test base class for reading and writing to files. - /// - [Obsolete("See: https://github.com/SixLabors/ImageSharp/issues/868")] - public abstract class FileTestBase - { - /// - /// TODO: We really should not depend on this! Let's use well defined, test-case specific inputs everywhere! - /// A collection made up of one file for each image format - /// - public static IEnumerable DefaultFiles = - new[] - { - TestImages.Bmp.Car, - TestImages.Jpeg.Baseline.Calliphora, - TestImages.Png.Splash, - TestImages.Gif.Trans - }; - - /// - /// A collection of all the bmp test images - /// - public static IEnumerable AllBmpFiles = TestImages.Bmp.Benchmark; - - /// - /// A collection of all the jpeg test images - /// - public static IEnumerable AllJpegFiles = TestImages.Jpeg.All; - - /// - /// A collection of all the png test images - /// - public static IEnumerable AllPngFiles = TestImages.Png.All; - - /// - /// A collection of all the gif test images - /// - public static IEnumerable AllGifFiles = TestImages.Gif.All; - - /// - /// The standard pixel format enumeration - /// - public const PixelTypes DefaultPixelType = PixelTypes.Rgba32; - - /// - /// A few other pixel types to prove that a processor is not bound to a single one. - /// - public const PixelTypes CommonNonDefaultPixelTypes = PixelTypes.Rgba32 | PixelTypes.Bgra32 | PixelTypes.RgbaVector; - - public static class Extensions - { - public const string Bmp = "bmp"; - - public const string Jpeg = "jpg"; - - public const string Png = "png"; - - public const string Gif = "gif"; - } - - /// - /// The collection of image files to test against. - /// - protected static readonly List Files = new List - { -#pragma warning disable SA1515 // Single-line comment should be preceded by blank line - TestFile.Create(TestImages.Jpeg.Baseline.Calliphora), - // TestFile.Create(TestImages.Jpeg.Baseline.Turtle), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Jpeg.Baseline.Ycck), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Jpeg.Baseline.Cmyk), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Jpeg.Baseline.Floorplan), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Jpeg.Progressive.Festzug), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Jpeg.Baseline.Bad.BadEOF), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Jpeg.Baseline.Bad.ExifUndefType), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Jpeg.Progressive.Fb), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Jpeg.Progressive.Progress), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Jpeg.Baseline.GammaDalaiLamaGray), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Jpeg.Progressive.Bad.BadEOF), // Perf: Enable for local testing only - TestFile.Create(TestImages.Bmp.Car), - // TestFile.Create(TestImages.Bmp.NegHeight), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Bmp.CoreHeader), // Perf: Enable for local testing only - TestFile.Create(TestImages.Png.Splash), - // TestFile.Create(TestImages.Png.SnakeGame), - // TestFile.Create(TestImages.Png.Cross), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Png.Bad.ChunkLength1), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Png.Bad.ChunkLength2), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Png.Powerpoint), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Png.Blur), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Png.Indexed), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Png.SplashInterlaced), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Png.Interlaced), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Png.Filter0), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Png.Filter1), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Png.Filter2), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Png.Filter3), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Png.Filter4), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Png.FilterVar), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Png.P1), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Png.Pd), // Perf: Enable for local testing only - TestFile.Create(TestImages.Gif.Rings), - // TestFile.Create(TestImages.Gif.Trans), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Gif.Cheers), // Perf: Enable for local testing only - // TestFile.Create(TestImages.Gif.Giphy) // Perf: Enable for local testing only - }; -#pragma warning restore SA1515 // Single-line comment should be preceded by blank line - } -} diff --git a/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs b/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs index c10cd8d298..a171d6d523 100644 --- a/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs +++ b/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs @@ -2,25 +2,47 @@ // Licensed under the Apache License, Version 2.0. using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; - using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.Formats.Png; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Processing.Processors.Quantization; - using Xunit; namespace SixLabors.ImageSharp.Tests.Formats { - public class GeneralFormatTests : FileTestBase + public class GeneralFormatTests { + /// + /// A collection made up of one file for each image format + /// + public static readonly IEnumerable DefaultFiles = + new[] + { + TestImages.Bmp.Car, + TestImages.Jpeg.Baseline.Calliphora, + TestImages.Png.Splash, + TestImages.Gif.Trans + }; + + /// + /// The collection of image files to test against. + /// + protected static readonly List Files = new List + { + TestFile.Create(TestImages.Jpeg.Baseline.Calliphora), + TestFile.Create(TestImages.Bmp.Car), + TestFile.Create(TestImages.Png.Splash), + TestFile.Create(TestImages.Gif.Rings), + }; + [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + [WithFileCollection(nameof(DefaultFiles), PixelTypes.Rgba32)] public void ResolutionShouldChange(TestImageProvider provider) where TPixel : unmanaged, IPixel { @@ -200,7 +222,7 @@ public void CanIdentifyImageLoadedFromBytes(int width, int height, string extens [Fact] public void IdentifyReturnsNullWithInvalidStream() { - byte[] invalid = new byte[10]; + var invalid = new byte[10]; using (var memoryStream = new MemoryStream(invalid)) { @@ -212,8 +234,7 @@ public void IdentifyReturnsNullWithInvalidStream() } private static IImageFormat GetFormat(string format) - { - return Configuration.Default.ImageFormats.FirstOrDefault(x => x.FileExtensions.Contains(format)); - } + => Configuration.Default.ImageFormats + .FirstOrDefault(x => x.FileExtensions.Contains(format)); } } diff --git a/tests/ImageSharp.Tests/Formats/ImageFormatManagerTests.cs b/tests/ImageSharp.Tests/Formats/ImageFormatManagerTests.cs index 98fbac7c04..dea8c62e19 100644 --- a/tests/ImageSharp.Tests/Formats/ImageFormatManagerTests.cs +++ b/tests/ImageSharp.Tests/Formats/ImageFormatManagerTests.cs @@ -46,45 +46,22 @@ public void IfAutoLoadWellKnownFormatsIsTrueAllFormatsAreLoaded() [Fact] public void AddImageFormatDetectorNullThrows() - { - Assert.Throws(() => - { - this.DefaultFormatsManager.AddImageFormatDetector(null); - }); - } + => Assert.Throws(() => this.DefaultFormatsManager.AddImageFormatDetector(null)); [Fact] public void RegisterNullMimeTypeEncoder() { - Assert.Throws(() => - { - this.DefaultFormatsManager.SetEncoder(null, new Mock().Object); - }); - Assert.Throws(() => - { - this.DefaultFormatsManager.SetEncoder(BmpFormat.Instance, null); - }); - Assert.Throws(() => - { - this.DefaultFormatsManager.SetEncoder(null, null); - }); + Assert.Throws(() => this.DefaultFormatsManager.SetEncoder(null, new Mock().Object)); + Assert.Throws(() => this.DefaultFormatsManager.SetEncoder(BmpFormat.Instance, null)); + Assert.Throws(() => this.DefaultFormatsManager.SetEncoder(null, null)); } [Fact] public void RegisterNullSetDecoder() { - Assert.Throws(() => - { - this.DefaultFormatsManager.SetDecoder(null, new Mock().Object); - }); - Assert.Throws(() => - { - this.DefaultFormatsManager.SetDecoder(BmpFormat.Instance, null); - }); - Assert.Throws(() => - { - this.DefaultFormatsManager.SetDecoder(null, null); - }); + Assert.Throws(() => this.DefaultFormatsManager.SetDecoder(null, new Mock().Object)); + Assert.Throws(() => this.DefaultFormatsManager.SetDecoder(BmpFormat.Instance, null)); + Assert.Throws(() => this.DefaultFormatsManager.SetDecoder(null, null)); } [Fact] @@ -133,11 +110,9 @@ public void DetectFormatAllocatesCleanBuffer() byte[] jpegImage; using (var buffer = new MemoryStream()) { - using (var image = new Image(100, 100)) - { - image.SaveAsJpeg(buffer); - jpegImage = buffer.ToArray(); - } + using var image = new Image(100, 100); + image.SaveAsJpeg(buffer); + jpegImage = buffer.ToArray(); } byte[] invalidImage = { 1, 2, 3 }; diff --git a/tests/ImageSharp.Tests/GlobalSuppressions.cs b/tests/ImageSharp.Tests/GlobalSuppressions.cs deleted file mode 100644 index 0411ce883f..0000000000 --- a/tests/ImageSharp.Tests/GlobalSuppressions.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Six Labors. -// Licensed under the Apache License, Version 2.0. - -// This file is used by Code Analysis to maintain SuppressMessage -// attributes that are applied to this project. -// Project-level suppressions either have no target or are given -// a specific target and scoped to a namespace, type, member, etc. -#pragma warning disable SA1404 // Code analysis suppression should have justification -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "xUnit1026:Theory methods should use all of their parameters")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "xUnit1013:Public method should be marked as test")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Assertions", "xUnit2013:Do not use equality check to check for collection size.")] -#pragma warning restore SA1404 // Code analysis suppression should have justification diff --git a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj index 5e97370ff2..5426144401 100644 --- a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj +++ b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj @@ -3,17 +3,13 @@ netcoreapp3.1;netcoreapp2.1;net472 - True True SixLabors.ImageSharp.Tests AnyCPU;x64;x86 SixLabors.ImageSharp.Tests - - true - diff --git a/tests/ImageSharp.Tests/TestImages.cs b/tests/ImageSharp.Tests/TestImages.cs index e4c73928de..d38ab80dac 100644 --- a/tests/ImageSharp.Tests/TestImages.cs +++ b/tests/ImageSharp.Tests/TestImages.cs @@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.Tests { /// /// Class that contains all the relative test image paths in the TestImages/Formats directory. - /// Use with , or . + /// Use with , . /// public static class TestImages { diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs index e3418220b0..67f11e8978 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs @@ -20,9 +20,7 @@ namespace SixLabors.ImageSharp.Tests public class TestEnvironmentTests { public TestEnvironmentTests(ITestOutputHelper output) - { - this.Output = output; - } + => this.Output = output; private ITestOutputHelper Output { get; } @@ -34,21 +32,15 @@ private void CheckPath(string path) [Fact] public void SolutionDirectoryFullPath() - { - this.CheckPath(TestEnvironment.SolutionDirectoryFullPath); - } + => this.CheckPath(TestEnvironment.SolutionDirectoryFullPath); [Fact] public void InputImagesDirectoryFullPath() - { - this.CheckPath(TestEnvironment.InputImagesDirectoryFullPath); - } + => this.CheckPath(TestEnvironment.InputImagesDirectoryFullPath); [Fact] public void ExpectedOutputDirectoryFullPath() - { - this.CheckPath(TestEnvironment.ReferenceOutputDirectoryFullPath); - } + => this.CheckPath(TestEnvironment.ReferenceOutputDirectoryFullPath); [Fact] public void GetReferenceOutputFileName()