MCPcopy Create free account
hub / github.com/ActiveState/code / search_jpg

Function search_jpg

recipes/Python/456375_File_Extractor/recipe-456375.py:146–156  ·  view source on GitHub ↗
(data, size)

Source from the content-addressed store, hash-verified

144 return file_list
145
146def search_jpg(data, size):
147 global jpg_magic_a, jpg_magic_z
148 file_list = list()
149 index_1 = data.find(jpg_magic_a)
150 index_2 = data.find(jpg_magic_z, index_1)
151 while index_1 != -1 and index_2 != -1:
152 if index_2 - index_1 == size - len(jpg_magic_z):
153 file_list.append(data[index_1:index_1+size])
154 index_1 = data.find(jpg_magic_a, index_1 + 1)
155 index_2 = data.find(jpg_magic_z, index_1)
156 return file_list
157
158def get_select(numbers):
159 while True:

Callers 1

extractFunction · 0.70

Calls 3

listClass · 0.85
findMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected