#
#   asdcplib uses headers size from source file to set the plaintext offset.
#   it is not possible to change plaintext offset with a parameter in command line.
#   this patch is only for testing purposes
#
--- a/src/JP2K_Codestream_Parser.cpp
+++ b/src/JP2K_Codestream_Parser.cpp
@@ -84,6 +84,11 @@ public:
 	byte_t start_of_data = 0; // out param
 	result = ParseMetadataIntoDesc(FB, m_PDesc, &start_of_data);
 
+    if ( getenv("PLAINTEXT_OFFSET") ) {
+        start_of_data = atoi(getenv("PLAINTEXT_OFFSET"));
+        printf("PlaintextOffset Override : %d bytes\n", start_of_data);
+    }
+
 	if ( ASDCP_SUCCESS(result) )
 	  FB.PlaintextOffset(start_of_data);
       }
