diff --git a/images/resources/META-INF/plugin.xml b/images/resources/META-INF/plugin.xml index 136a13837cc1..c69c0299a57c 100644 --- a/images/resources/META-INF/plugin.xml +++ b/images/resources/META-INF/plugin.xml @@ -30,6 +30,7 @@ + diff --git a/images/resources/META-INF/services/javax.imageio.spi.ImageReaderSpi b/images/resources/META-INF/services/javax.imageio.spi.ImageReaderSpi deleted file mode 100644 index 52a4d9483612..000000000000 --- a/images/resources/META-INF/services/javax.imageio.spi.ImageReaderSpi +++ /dev/null @@ -1,2 +0,0 @@ -org.intellij.images.util.imageio.CommonsImagingImageReaderSpi -org.intellij.images.util.imageio.svg.SvgImageReaderSpi \ No newline at end of file diff --git a/images/src/org/intellij/images/util/imageio/ImageReaderSpiRegistrar.kt b/images/src/org/intellij/images/util/imageio/ImageReaderSpiRegistrar.kt new file mode 100644 index 000000000000..bf0295a2df2b --- /dev/null +++ b/images/src/org/intellij/images/util/imageio/ImageReaderSpiRegistrar.kt @@ -0,0 +1,17 @@ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package org.intellij.images.util.imageio + +import com.intellij.ide.ApplicationLoadListener +import com.intellij.openapi.application.Application +import org.intellij.images.util.imageio.svg.SvgImageReaderSpi +import java.nio.file.Path +import javax.imageio.spi.IIORegistry +import javax.imageio.spi.ImageReaderSpi + +class ImageReaderSpiRegistrar: ApplicationLoadListener { + override suspend fun beforeApplicationLoaded(application: Application, configPath: Path) { + val defaultInstance = IIORegistry.getDefaultInstance() + defaultInstance.registerServiceProvider(CommonsImagingImageReaderSpi(), ImageReaderSpi::class.java) + defaultInstance.registerServiceProvider(SvgImageReaderSpi(), ImageReaderSpi::class.java) + } +} \ No newline at end of file