Skip to content

Commit

Permalink
Merge pull request #523 from kagemomiji/issue516-support-webp-coverar…
Browse files Browse the repository at this point in the history
…t-image

#516 Support webp images for CoverArt
  • Loading branch information
kagemomiji committed Jun 28, 2024
2 parents 50aefe4 + e30fa51 commit 9314197
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ Other properties are obsolete and have been removed:

First migration to 11.x will create a backup DB next to the DB folder. It will be marked as `db.backup.<timestamp>`. Use this folder as the DB if a revert to an older major version is needed (11.0 -> 10.6.0).

> **Warning**
If you use HSQLDB for 10.6.0, DB migration must fails.
First upgrade to 11.0.0-SNAPSHOT.20221224143241 then upgrade to latest release.
> [!WARNING]
> If you use HSQLDB for 10.6.0, DB migration must fails.
> First upgrade to 11.0.0-SNAPSHOT.20221224143241 then upgrade to latest release.
Troubleshooting
------
Expand Down Expand Up @@ -259,6 +259,8 @@ released under [MIT License](http://www.opensource.org/licenses/mit-license.php)
The icons are from the amazing [feather](https://feathericons.com/) project,
and are licensed under [MIT license](https://github.com/feathericons/feather/blob/master/LICENSE).

The cover art functionality supporting multiple image file formats is powered by the [TwelveMonkeys](https://github.com/haraldk/TwelveMonkeys) library, which is released under the [BSD3 License](https://github.com/haraldk/TwelveMonkeys/blob/main/LICENSE.md).

Community
---------
Bugs/feature requests/discussions pertaining to kagemomiji/airsonic-advanced may be raised as issues within GitHub on the Airsonic-Advanced project page.
Expand Down
5 changes: 5 additions & 0 deletions airsonic-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,11 @@
<artifactId>hamcrest-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-webp</artifactId>
<version>3.11.0</version>
</dependency>

</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public class SettingsService {
private static final String DEFAULT_SHORTCUTS = "New Incoming Podcast";
private static final String DEFAULT_MUSIC_FILE_TYPES = "mp3 ogg oga aac m4a m4b flac wav wma aif aiff ape mpc shn mka opus alm 669 mdl far xm mod fnk imf it liq wow mtm ptm rtm stm s3m ult dmf dbm med okt emod sfx m15 mtn amf gdm stx gmc psm j2b umx amd rad hsc flx gtk mgt mtp wv";
private static final String DEFAULT_VIDEO_FILE_TYPES = "flv avi mpg mpeg mp4 m4v mkv mov wmv ogv divx m2ts webm";
private static final String DEFAULT_COVER_ART_FILE_TYPES = "cover.jpg cover.png cover.gif folder.jpg jpg jpeg gif png";
private static final String DEFAULT_COVER_ART_FILE_TYPES = "cover.jpg cover.png cover.gif folder.jpg jpg jpeg gif png webp";
private static final String DEFAULT_COVER_ART_SOURCE = CoverArtSource.FILETAG.name();
private static final int DEFAULT_COVER_ART_CONCURRENCY = 4;
private static final int DEFAULT_COVER_ART_QUALITY = 90;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
You should have received a copy of the GNU General Public License
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2024 (C) Y.Tory
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
Expand Down Expand Up @@ -82,6 +83,7 @@ public final class StringUtil {
{"jpeg", "image/jpeg"},
{"png", "image/png"},
{"bmp", "image/bmp"},
{"webp", "image/webp"},

{"zip", "application/zip"},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public void testGetMimeType() {
assertEquals("audio/mpeg", StringUtil.getMimeType("mp3"), "Error in getMimeType()");
assertEquals("audio/mpeg", StringUtil.getMimeType(".mp3"), "Error in getMimeType()");
assertEquals("audio/mpeg", StringUtil.getMimeType(".MP3"), "Error in getMimeType()");
assertEquals("image/webp", StringUtil.getMimeType(".webp"), "Error in getMimeType()");
assertEquals("application/octet-stream", StringUtil.getMimeType("koko"), "Error in getMimeType()");
assertEquals("application/octet-stream", StringUtil.getMimeType(""), "Error in getMimeType()");
assertEquals("application/octet-stream", StringUtil.getMimeType(null), "Error in getMimeType()");
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@
<ignoredUnusedDeclaredDependency>org.eclipse.persistence:org.eclipse.persistence.moxy</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.apache.cxf:cxf-tools-wsdlto-databinding-jaxb</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.apache.lucene:lucene-backward-codecs</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>com.twelvemonkeys.imageio:imageio-webp</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
</execution>
Expand Down

0 comments on commit 9314197

Please sign in to comment.