Redth / ResizetizerNT

Add SVG's and PNG's to your shared Xamarin Project
MIT License
318 stars 31 forks source link

Added option to prefix postfix resized images #34

Closed Feroks closed 3 years ago

Feroks commented 3 years ago

I needed to Tint same icon into multiple colors. Since file name is the same, only last TintColor definition persists. By adding prefixes or postfixes we can alter file name, which will solve overwrite problem.

mattleibow commented 3 years ago

I think this might be a more generic approach: https://github.com/Redth/ResizetizerNT/pull/55

Feroks commented 3 years ago

Good point, it does seem more convenient to use. However, does your PR support wildcards such as: %(RecursiveDir), %(FileName), %(Extension) like Link does for regular files? I include icons by directories to avoid inflating .csporj file and this way you can easily specify how to adjust name for all files.

mattleibow commented 3 years ago

However, does your PR support wildcards such as: %(RecursiveDir), %(FileName), %(Extension) like Link does for regular files?

Let me try as I think it should.

mattleibow commented 3 years ago

Seems it does:

  <ItemGroup>
    <SharedImage Include="images\**\*" Link="%(RecursveDir)new_name_%(FileName)%(Extension)" />
  </ItemGroup>
images android ios
image image image

This is because these values are evaluated before it even gets to our tasks.

NOTE: there is no nesting support since Android itself does not support this.

Feroks commented 3 years ago

Great! Then this PR can be closed.

mattleibow commented 3 years ago

Awesome! Thanks for raising the idea! Great to get all this in!