-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
284 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
The MIT License (MIT) | ||
Copyright © 2023 Louis Waweru (PPDAC LTD) | ||
|
||
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: | ||
|
||
You must verbally indicate and acknowledge your next encounter with a good dog, | ||
e.g.: "That's a good doggy!" | ||
|
||
You must not verbally indicate or acknowledge your next encounter with a "bad" | ||
dog. Despite any issues that may arise, you must refrain from outing or shaming | ||
"bad" dogs. | ||
|
||
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. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
The MIT License (MIT) | ||
Copyright © 2023 Louis Waweru (PPDAC LTD) | ||
|
||
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: | ||
|
||
You must verbally indicate and acknowledge your next encounter with a good dog, | ||
e.g.: "That's a good doggy!" | ||
|
||
You must not verbally indicate or acknowledge your next encounter with a "bad" | ||
dog. Despite any issues that may arise, you must refrain from outing or shaming | ||
"bad" dogs. | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,55 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net7.0;net8.0;</TargetFrameworks> | ||
|
||
|
||
<TargetFrameworks> | ||
net7.0; | ||
net7.0-android; | ||
net7.0-ios; | ||
net7.0-maccatalyst; | ||
net7.0-windows10.0.17763.0; | ||
net7.0-windows10.0.19041.0; | ||
net7.0-windows10.0.22000.0; | ||
net7.0-windows10.0.22621.0; | ||
net8.0; | ||
net8.0-android; | ||
net8.0-ios; | ||
net8.0-maccatalyst; | ||
net8.0-windows10.0.17763.0; | ||
net8.0-windows10.0.19041.0; | ||
net8.0-windows10.0.22000.0; | ||
net8.0-windows10.0.22621.0; | ||
</TargetFrameworks> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild> | ||
<Title>Ppdac.Cache.Maui.ImageCache</Title> | ||
<PackageId>$(AssemblyName)</PackageId> | ||
<Authors>LouisWaweru</Authors> | ||
<Authors>Louis Waweru</Authors> | ||
<Company>PPDAC, Ltd.</Company> | ||
<Description> | ||
Use this middleware to cache images from the Internet. Wherever you would give a control a URL, a stream, or byte[], | ||
continue doing that as normal, but have ImageCache act as the intermediary. For example, instead of ImageSource = Uri, do ImageSource = ImageCache(Uri). | ||
</Description> | ||
<Description>Use this middleware to cache images from the Internet. Wherever you would give a control a URL, a stream, or byte[], continue doing that as normal, but have ImageCache act as the intermediary. For example, instead of ImageSource = Uri, do ImageSource = ImageCache(Uri).</Description> | ||
<Copyright>©2023 Louis A. Waweru; PPDAC, Ltd.</Copyright> | ||
<PackageProjectUrl>https://ppdac.ltd/ImageCache</PackageProjectUrl> | ||
<PackageTags>cache; caching; image cache; </PackageTags> | ||
<PackageTags>cache; caching; image cache; maui;</PackageTags> | ||
<PackageReleaseNotes>This version is for use in .NET MAUI. For other projects you may instead use: Ppdac.Cache.ImageCache.</PackageReleaseNotes> | ||
<IncludeSymbols>True</IncludeSymbols> | ||
<SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
<GenerateDocumentationFile>True</GenerateDocumentationFile> | ||
<PackageIcon>ppdac-square-logo.png</PackageIcon> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.3" PrivateAssets="compile;contentfiles;build;analyzers"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Ppdac.Cache\Ppdac.Cache.csproj" /> | ||
<ProjectReference Include="..\Ppdac.Cache\Ppdac.Cache.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.3" /> | ||
<None Include="Icons\ppdac-square-logo.png"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
<Pack>True</Pack> | ||
<PackagePath>\</PackagePath> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# ImageCache | ||
This library allows one to save bandwidth or API calls by caching images locally in a cache folder. | ||
|
||
For .NET MAUI apps, the location of this folder is decided by [FileSystem.CacheDirectory](https://learn.microsoft.com/en-us/dotnet/api/microsoft.maui.storage.filesystem.cachedirectory), | ||
and for .NET 6.0 Windows apps, it is decided by [Environment.SpecialFolder.ApplicationData](https://docs.microsoft.com/en-us/dotnet/api/system.environment.specialfolder?view=net-6.0#System_Environment_SpecialFolder_ApplicationData). | ||
|
||
This version for .NET MAUI apps adds a new method to the `ImageCache` class, `GetAsImageSourceAsync(Uri uri)`, which returns an `ImageSource` instead of a `Stream`, `byte[]` or `Func<Stream>`. | ||
This is useful for binding to an `Image` control's `Source` property, which are often given a URI to a web resource. | ||
|
||
In place of the URI, use `GetAsImageSourceAsync(Uri uri)` instead, which will remember if this URI has been cached before, and if so, return the cached image source instead of downloading it again. | ||
|
||
Because it is derived from the general-purpose `ImageCache` class, it can also be used for other classes not specific to .NET MAUI, such as Bitmaps, or other image types that can accept | ||
byte arrays or streams. | ||
|
||
# Usage | ||
Todo: learn the new GitHub usage thingy. | ||
|
||
# Contibuting | ||
You are actively encouraged to report bugs and contribute to this repository. | ||
|
||
Contributions Are Appreciated and Welcome | ||
-------------------------------------------- | ||
* If you want to improve this library: | ||
- Please make a pull request to: https://github.com/ppdac/Ppdac.Cache.Maui/pulls | ||
* Contributions to this repository, any Fork, or copy remains with PPDAC LTD under the MIT license terms. | ||
* You may add a note to any significant code contributions you have made, but may not copyright or patent your changes. | ||
* You may not modify licensing or copyright of any part or any derivative work (including a fork) of this software in any way without formal written consent. | ||
|
||
Bugs and Issues | ||
-------------------------------------------- | ||
* Check the issue log in case your issue is already documented. | ||
* To make a Pull Request: https://github.com/ppdac/Ppdac.ImageCache.Maui/pulls | ||
* To report an issue: https://github.com/ppdac/Ppdac.ImageCache.Maui/issues | ||
|
||
License Awareness | ||
-------------------------------------------- | ||
You should be aware of the license of all required or optional Nuget dependencies including .NET libraries published on nuget.org or elsewhere including: | ||
* Microsoft.Maui.Controls under MIT licensing (like this is). | ||
* Microsoft.Maui.Storage under MIT licensing. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,5 @@ | ||
Ppdac.Cache.ImageCache License v1.0 November 13, 2023 | ||
Copyright (c) Louis A. Waweru; PPDAC, Ltd. | ||
|
||
Ppdac.Cache.Maui License v1.0 November 13, 2023 | ||
============================================ | ||
|
||
Summary: | ||
1. You may license this software Commercially or Open Source at your own choice. | ||
2. You are actively encouraged to report bugs and contribute to this repository. | ||
|
||
PPDAC Contribution Agreement | ||
============================================ | ||
This PPDAC LTD (aka “PPDAC” or “Louis Waweru”) project and everyone participating in it is governed by the following Contribution Agreement which may evolve over time. | ||
By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to [email protected]. | ||
|
||
Contributions Are Appreciated and Welcome | ||
-------------------------------------------- | ||
* If you are skilled enough to improve this library please share: | ||
- Please make a pull request to: https://github.com/ppdac/Ppdac.Cache.Maui/pulls | ||
* Contributions to this repository, any Fork, or copy remains with PPDAC LTD under the MIT license terms. | ||
* You may add a note to any significant code contributions you have made, but may not copyright or patent your changes. | ||
* You may not modify licensing or copyright of any part or any derivative work (including a fork) of this software in any way without formal written consent. | ||
|
||
Bugs and Issues | ||
-------------------------------------------- | ||
* Commercial Licensing users are entitled to support and SLA as purchased. | ||
* Check the issue log in case your issue is already documented. | ||
* Make a Pull Request if you are technically capable. | ||
* To make a Pull Request: https://github.com/ppdac/Ppdac.ImageCache.Maui/pulls | ||
* To post an issue: https://github.com/ppdac/Ppdac.ImageCache.Maui/issues | ||
|
||
License Awareness | ||
-------------------------------------------- | ||
This license adapted from IronSoftware.Drawing Split License Version 1.0 Sep 2022. | ||
Obey copyright and patents. The software industry revolves on trust. | ||
You should be aware of the license of all required or optional Nuget dependencies including .NET libraries published on nuget.org or elsewhere including: | ||
* Microsoft.Maui.Controls under MIT licensing (like this is). | ||
* Microsoft.Maui.Storage under MIT licensing. | ||
|
||
Permissive Split Licensing | ||
-------------------------------------------- | ||
Works in Source or Object form are split licensed and may be licensed your choice of either: | ||
1. PPDAC Software Commercial Licensing documented below | ||
2. MIT Open Source License included in this document | ||
|
||
PPDAC Commercial Licensing | ||
============================================ | ||
You may choose Commercial Licensing for this software and / or its derived works by purchasing “PPDAC .NET” at https://ppdac.ltd/license/ | ||
|
||
Summary of Commercial Licensing Benefits: | ||
-------------------------------------------- | ||
It is often worth paying for something that is free: | ||
* Developer support is available to Commercial Licensing customers when purchased and agreed by both parties. | ||
* Purchasing gives you the option to replace the MIT Open Source license below with Commercial Licensing | ||
* Commercial Licensing Terms are found at: https://github.com/ppdac/Ppdac.Cache/blob/master/NuGet/EULA.txt and within this software. | ||
* The MIT public license agreement no longer applies and the MIT license below need not be shipped inside or alongside your software | ||
* Enhanced versions of Ppdac.ImageCache.Maui with additional features may be released and available to Commercial Licensing users. | ||
* This may include: | ||
* Additional features and documentation | ||
|
||
Open Source Licensing | ||
============================================ | ||
If Commercial Licensing is not purchased, then Open Source Licensing applies. | ||
The MIT License that immediately follows, should be included inside your product or project as clearly as possible. | ||
|
||
The MIT License (MIT) | ||
Copyright (c) 2023 Louis Waweru (PPDAC LTD) | ||
Copyright © 2023 Louis Waweru (PPDAC LTD) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
@@ -73,6 +8,13 @@ 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: | ||
|
||
You must verbally indicate and acknowledge your next encounter with a good dog, | ||
e.g.: "That's a good doggy!" | ||
|
||
You must not verbally indicate or acknowledge your next encounter with a "bad" | ||
dog. Despite any issues that may arise, you must refrain from outing or shaming | ||
"bad" dogs. | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
using System; | ||
//using System; | ||
|
||
namespace ImageCache; | ||
// All the code in this file is only included on Tizen. | ||
public class PlatformClass1 | ||
{ | ||
} | ||
//namespace ImageCache; | ||
//// All the code in this file is only included on Tizen. | ||
//public class PlatformClass1 | ||
//{ | ||
//} |
Oops, something went wrong.