Commits

Flávio Coelho committed b45b7a6

pequenas mudanças em stegano

  • Participants
  • Parent commits ec5eac1

Comments (0)

Files changed (1)

         '''
         self.capacity = 0
         self.im = None #empty image
-        self. limg = None #loaded image
+        self.limg = None #loaded image
         if carrier:
             self._addCarrier(carrier)
             if msg:
             print "Message too long for this image"
             return
         msglayer = np.ones((w,h,1),int) #Create alpha layer
+        #~ msglayer *=5
+        #~ print self.im.shape, msglayer.shape
         for n,i in enumerate(encMSG):
             msglayer.ravel()[n] = i
         
         else:
             #overwrite alpha layer with message
             self.im[:,:,3] = msglayer
+        
         self.limg = self.im
+        
+
 
         
     def _addCarrier(self, url):
         if img.shape[2] < 4:
             return
 
-        data = img[:,:,3]
-        txt = ''.join(map(chr,data.ravel()))
+        data = img[:,:,3].ravel()
+        txt = ''.join(map(chr,data))
         ms = txt.find('MSGSTART')
         me = txt.find('MSGEND')
         if ms < 0: