Remote Image Processing (#1684)

* Update ServerConfig.kt

* Update ConversionUtil.kt

* Update Page.kt

* Update ServerConfig.kt

fixed deletions caused by ide

* Update ServerConfig.kt

* Update ServerConfig.kt

* Cleanup

* Post-processing terminology

* More comments

* Lint

* Add known image mimes

* Fix weird mime set/get

* Implement different downloadConversions and serveConversions

* Lint

* Improve Post-Processing massivly

* Fix thumbnail build

* Use Array for headers

* Actually fix headers

* Actually fix headers 2

* Manually parse DownloadConversion

* Cleanup parse

* Fix write

* Update TypeName

* Optimize imports

* Remove header type

* Fix build

---------

Co-authored-by: Syer10 <syer10@users.noreply.github.com>
This commit is contained in:
FadedSociety
2025-11-12 14:23:34 -07:00
committed by GitHub
parent 3e47859d88
commit 0a7e6cce87
16 changed files with 527 additions and 188 deletions

View File

@@ -14,6 +14,8 @@
* limitations under the License.
*/
package libcore.net;
import android.annotation.Nullable;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
@@ -249,10 +251,12 @@ public final class MimeUtils {
add("audio/x-scpls", "pls");
add("audio/x-sd2", "sd2");
add("audio/x-wav", "wav");
add("image/avif", "avif");
// image/bmp isn't IANA, so image/x-ms-bmp should come first.
add("image/x-ms-bmp", "bmp");
add("image/bmp", "bmp");
add("image/gif", "gif");
add("image/heif", "heif");
// image/ico isn't IANA, so image/x-icon should come first.
add("image/x-icon", "ico");
add("image/ico", "cur");
@@ -262,6 +266,7 @@ public final class MimeUtils {
add("image/jpeg", "jpg");
add("image/jpeg", "jpeg");
add("image/jpeg", "jpe");
add("image/jxl", "jxl");
add("image/pcx", "pcx");
add("image/png", "png");
add("image/svg+xml", "svg");
@@ -438,6 +443,7 @@ public final class MimeUtils {
* @return The extension has been registered for
* the given case insensitive MIME type or null if there is none.
*/
@Nullable
public static String guessExtensionFromMimeType(String mimeType) {
if (mimeType == null || mimeType.isEmpty()) {
return null;