diff --git a/plugin.xml b/plugin.xml
index 6e135ba..8f0eceb 100755
--- a/plugin.xml
+++ b/plugin.xml
@@ -17,17 +17,20 @@
This is useful for methods called via reflection that could appear as unused to Proguard.
+ */
+@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR})
+@Retention(CLASS)
+public @interface DoNotStrip {}
\ No newline at end of file
diff --git a/src/android/utils/ImageSize.java b/src/android/utils/ImageSize.java
new file mode 100644
index 0000000..5d29d93
--- /dev/null
+++ b/src/android/utils/ImageSize.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+package com.spoon.spectrum.utils;
+
+import javax.annotation.concurrent.Immutable;
+
+/** Represents a rectangular area defined by its width and height. */
+@DoNotStrip
+@Immutable
+public class ImageSize {
+
+ /**
+ * Setting to 2**16 as this is the smallest common denominator for all common image libraries that
+ * we are interested in.
+ */
+ @DoNotStrip static final int MAX_IMAGE_SIDE_DIMENSION = 65536;
+
+ /** The size's width. */
+ @DoNotStrip public final int width;
+
+ /** The size's height. */
+ @DoNotStrip public final int height;
+
+ /**
+ * Creates a new {@link ImageSize}
+ *
+ * @param width Must be within [0, {@link #MAX_IMAGE_SIDE_DIMENSION}]
+ * @param height Must be within [0, {@link #MAX_IMAGE_SIDE_DIMENSION}]
+ */
+ @DoNotStrip
+ public ImageSize(final int width, final int height) {
+ Preconditions.checkArgument(width >= 0 && width <= MAX_IMAGE_SIDE_DIMENSION);
+ Preconditions.checkArgument(height >= 0 && height <= MAX_IMAGE_SIDE_DIMENSION);
+ this.width = width;
+ this.height = height;
+ }
+
+ @Override
+ public boolean equals(final Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ final ImageSize that = (ImageSize) o;
+ return width == that.width && height == that.height;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = width;
+ result = 31 * result + height;
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "ImageSize{" + "width=" + width + ", height=" + height + '}';
+ }
+}
diff --git a/src/android/utils/Preconditions.java b/src/android/utils/Preconditions.java
new file mode 100644
index 0000000..b418a09
--- /dev/null
+++ b/src/android/utils/Preconditions.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+package com.spoon.spectrum.utils;
+
+import androidx.annotation.Nullable;
+
+/** Light-weight implementation for Precondition checks. */
+public final class Preconditions {
+
+ private Preconditions() {}
+
+ /**
+ * Asserts that the given reference is not null.
+ *
+ * @param reference A reference that might be null
+ * @return reference if reference is not null
+ * @throws NullPointerException if the given reference is null
+ */
+ public static false
+ */
+ public static void checkArgument(final boolean assertion) {
+ if (!assertion) {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ /**
+ * Asserts that the given assertion about a state is true.
+ *
+ * @param assertion The assertion to check
+ * @throws IllegalStateException if the given assertion is false
+ */
+ public static void checkState(final boolean assertion) {
+ if (!assertion) {
+ throw new IllegalStateException();
+ }
+ }
+}
diff --git a/src/ios/SpectrumManager.h b/src/ios/SpectrumManager.h
index 75b9122..5596ba4 100644
--- a/src/ios/SpectrumManager.h
+++ b/src/ios/SpectrumManager.h
@@ -7,13 +7,9 @@
#import