mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
WEB-52274 ImageReaderSpi register file is ignored in the runtime. Use ApplicationLoadListener to register service providers
(cherry picked from commit d6ba8400117c2a392e2d864116c5fc33dafb3a44) IJ-CR-148627 GitOrigin-RevId: 72a5ee9956403a1bf264f25bc2099fd1db5577af
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6a7ed7a79a
commit
e5b07397c4
@@ -30,6 +30,7 @@
|
||||
<fileType name="SVG" implementationClass="org.intellij.images.fileTypes.impl.SvgFileType" fieldName="INSTANCE" extensions="svg" language="SVG"/>
|
||||
<fileLookupInfoProvider implementation="org.intellij.images.completion.ImageLookupInfoProvider"/>
|
||||
<documentationProvider implementation="org.intellij.images.fileTypes.ImageDocumentationProvider"/>
|
||||
<ApplicationLoadListener implementation="org.intellij.images.util.imageio.ImageReaderSpiRegistrar"/>
|
||||
|
||||
<filePasteProvider implementation="org.intellij.images.ide.ImagePasteProvider" order="last"/>
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
org.intellij.images.util.imageio.CommonsImagingImageReaderSpi
|
||||
org.intellij.images.util.imageio.svg.SvgImageReaderSpi
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user