I have to analyse a picture and figure out if it has been modified by Photoshop. Using MetadataExtractor I got the following information (in the format of Directory:TagName=TagDescription):
JPEG:Data Precision=8 bits
JPEG:Image Height=1600 pixels
JPEG:Image Width=1200 pixels
JPEG:Number of Components=3
JPEG:Component 1=Y component: Quantization table 0
Sampling factors 2 horiz/2 vert
JPEG:Component 2=Cb component: Quantization table 1
Sampling factors 1 horiz/1 vert
JPEG:Component 3=Cr component: Quantization table 1
Sampling factors 1 horiz/1 vert
JFIF:Version=1.1
JFIF:Resolution Units=none
JFIF:X Resolution=72 dots
JFIF:Y Resolution=72 dots
JFIF:Thumbnail Width Pixels=0
JFIF:Thumbnail Height Pixels=0
Exif IFD0:Orientation=Top
left side (Horizontal / normal)
Exif SubIFD:Color Space=sRGB
Exif SubIFD:Exif Image Width=1200 pixels
Exif SubIFD:Exif Image Height=1600 pixels
Photoshop:Caption Digest=212 29 140 217 143 0 178 4 233 128 9 152 236 248 66 126
File:File Name=mypicture.jpg
File:File Size=175794 bytes
File:File Modified Date=Thu Sep 29 14:22:44 +02:00 2016
Now, question is: can the Photoshop:Caption Digest=212 29 140 217 143 0 178 4 233 128 9 152 236 248 66 126 metadata be generated by a program that is NOT Photoshop? Or is it an evidence that the image was photoshopped?
Related
I encountered a strange problem when analyzing memory leaks in windbg... Memory was lost...
!address -summary shows MEM_COMMIT = 3.3G
0:048> !address -summary
Mapping file section regions...
Mapping module regions...
Mapping PEB regions...
Mapping TEB and stack regions...
Mapping heap regions...
Mapping page heap regions...
Mapping other regions...
Mapping stack trace database regions...
Mapping activation context regions...
--- Usage Summary ---------------- RgnCount ----------- Total Size -------- %ofBusy %ofTotal
Free 447 7df8`acd2e000 ( 125.971 TB) 98.42%
<unknown> 1688 207`19afc000 ( 2.028 TB) 99.96% 1.58%
Stack 234 0`18260000 ( 386.375 MB) 0.02% 0.00%
Heap 120 0`168ec000 ( 360.922 MB) 0.02% 0.00%
Image 1856 0`0aa00000 ( 170.000 MB) 0.01% 0.00%
Other 11 0`001dd000 ( 1.863 MB) 0.00% 0.00%
TEB 78 0`0009c000 ( 624.000 kB) 0.00% 0.00%
PEB 1 0`00001000 ( 4.000 kB) 0.00% 0.00%
--- Type Summary (for busy) ------ RgnCount ----------- Total Size -------- %ofBusy %ofTotal
MEM_MAPPED 387 200`03a66000 ( 2.000 TB) 98.59% 1.56%
MEM_PRIVATE 1745 7`44e5c000 ( 29.077 GB) 1.40% 0.02%
MEM_IMAGE 1856 0`0aa00000 ( 170.000 MB) 0.01% 0.00%
--- State Summary ---------------- RgnCount ----------- Total Size -------- %ofBusy %ofTotal
MEM_FREE 447 7df8`acd2e000 ( 125.971 TB) 98.42%
MEM_RESERVE 631 206`7d08b000 ( 2.025 TB) 99.84% 1.58%
MEM_COMMIT 3357 0`d6237000 ( 3.346 GB) 0.16% 0.00%
--- Protect Summary (for commit) - RgnCount ----------- Total Size -------- %ofBusy %ofTotal
PAGE_READWRITE 1587 0`c52ee000 ( 3.081 GB) 0.15% 0.00%
PAGE_READONLY 1147 0`0816b000 ( 129.418 MB) 0.01% 0.00%
PAGE_EXECUTE_READ 312 0`05f0a000 ( 95.039 MB) 0.00% 0.00%
PAGE_EXECUTE_READWRITE 57 0`019a1000 ( 25.629 MB) 0.00% 0.00%
PAGE_NOACCESS 129 0`013d8000 ( 19.844 MB) 0.00% 0.00%
PAGE_READWRITE|PAGE_GUARD 78 0`000ec000 ( 944.000 kB) 0.00% 0.00%
PAGE_WRITECOPY 47 0`0006f000 ( 444.000 kB) 0.00% 0.00%
--- Largest Region by Usage ----------- Base Address -------- Region Size ----------
Free 1c6`45d8f000 7c2e`42281000 ( 124.181 TB)
<unknown> 7dfc`a2a6d000 1f8`bfa04000 ( 1.972 TB)
Stack 45`800c0000 0`0104b000 ( 16.293 MB)
Heap 1c6`3636f000 0`07d01000 ( 125.004 MB)
Image 7ffa`bafbf000 0`00e7a000 ( 14.477 MB)
Other 1c0`05d40000 0`00181000 ( 1.504 MB)
TEB 45`f68b0000 0`00002000 ( 8.000 kB)
PEB 45`f6939000 0`00001000 ( 4.000 kB)
!eeheap shows the total memory of the heap 900M。[gc (798M) + loader(132M) ]
0:048> !eeheap
Loader Heap:
--------------------------------------
System Domain: 00007ffa7929d0a0
...
Module 00007ffa1e71d6a0: Size: 0x0 (0) bytes.
Module 00007ffa1ec8da48: Size: 0x0 (0) bytes.
Module 00007ffa1ee3cb18: Size: 0x0 (0) bytes.
Module 00007ffa1f439618: Size: 0x0 (0) bytes.
Total size: Size: 0x0 (0) bytes.
--------------------------------------
Total LoaderHeap size: Size: 0x7dfd000 (132108288) bytes total, 0x2d4000 (2965504) bytes wasted.
=======================================
Number of GC Heaps: 16
------------------------------
Heap 0 (000001C0069F7AE0)
...
Heap 15 (000001C006E01BA0)
generation 0 starts at 0x000001C5A7770600
generation 1 starts at 0x000001C5A776B898
generation 2 starts at 0x000001C5A7121000
ephemeral segment allocation context: none
segment begin allocated size
000001C5A7120000 000001C5A7121000 000001C5A883B790 0x171a790(24225680)
Large object heap starts at 0x000001C5E7121000
segment begin allocated size
000001C5E7120000 000001C5E7121000 000001C5E774D1E0 0x62c1e0(6472160)
Pinned object heap starts at 0x000001C5F7121000
000001C5F7120000 000001C5F7121000 000001C5F7390EF8 0x26fef8(2555640)
Heap Size: Size: 0x1fb6868 (33253480) bytes.
------------------------------
GC Heap Size: Size: 0x2f9480a0 (798261408) bytes.
!eeheap -s shows 68M of unmanaged memory
0:048> !heap -s
************************************************************************************************************************
NT HEAP STATS BELOW
************************************************************************************************************************
LFH Key : 0x741d83161cb41a46
Termination on corruption : ENABLED
Heap Flags Reserv Commit Virt Free List UCR Virt Lock Fast
(k) (k) (k) (k) length blocks cont. heap
-------------------------------------------------------------------------------------
000001c0057d0000 00000002 97696 68108 97304 10566 686 18 7 51 LFH
External fragmentation 15 % (686 free blocks)
000001c005750000 00008000 64 4 64 2 1 1 0 0
000001c005b30000 00001002 3516 2564 3124 116 43 3 0 1 LFH
000001c006790000 00001002 60 8 60 5 1 1 0 0
000001c006740000 00001003 60 8 60 6 1 1 0 N/A
000001c007030000 00001002 1472 156 1080 2 14 2 0 0 LFH
000001c007110000 00041002 60 8 60 5 1 1 0 0
000001c617d60000 00041002 452 24 60 0 2 1 0 0 LFH
000001c616060000 00001002 1472 216 1080 22 11 2 0 0 LFH
-------------------------------------------------------------------------------------
Conclusion: gc heap(798M) + loader heap(132M) + unmanged heap(68M) is much smaller than 3.3G of process memory.
Where did my remaining memory of about 2G go? Thank you all in advance.
what are you looking for in the dump if you want to know the details of MEM_COMMIT
you can issue !address -f:MEM_COMMIT
use .logopen x:\foo.ext and log the results to a file
as the resulting output maybe large
here is a verification of summary mem_commit size versus filtered mem_commit size
0:000> .shell -ci "!address -summary" grep -i mem_COMMIT
MEM_COMMIT 155 0`02f3d000 ( **47.238 MB**) 0.00% 0.00%
.shell: Process exited
0:000> r$t0=0;!address -f:MEM_COMMIT -c:"r $t0 = #$t0+%3";?? #$t0/1048576.0
double **47.23828125**
0:000>
798 MB GC Heap (as mentioned by you)
132 MB Loader Heap (as mentioned by you)
68 MB Native Heap (as mentioned by you)
>15 MB Stacks (at 64kB each, for 234 Stacks)
170 MB Image (DLLs that are loaded)
-------
1183 MB
The rest is probably native heap as well, but with allocations > 512 kB, so they are not handled by the heap manager any more but will be treated like VirtualAlloc() calls and thus fall into the <unknown> category.
I have taken the data from a web browser. Now I want to export the data from the web browser to excel.
I get data from web browser such formats:
1
20 143
10 180
1 653
8 310
1 280
1 280
1 280
1 280
:
:
:
2
19 339
9 800
1 767
7 773
1 280
1 280
1 280
1 280
H2:DA_MI
H2:DA_MI
H2:DA_MI
I'm compressing short string on my machine using DeflateStream
public byte[] Compress(byte[] oryginalBytes)
{
using (var msi = new MemoryStream(oryginalBytes))
using (var mso = new MemoryStream())
{
using (var gs = new DeflateStream(mso, CompressionMode.Compress))
{
msi.CopyTo(gs);
}
return mso.ToArray();
}
}
And run this code:
Compress(Encoding.Unicode.GetBytes("[TEST]"));
On my machine (windows 7 64 bit) I get 12 elements byte array:
139 102 8 97 112 101 8 6 146 177 12 0
And running this on my build server (Windows 2008 64bit) I have 120 elements byte array.
236 189 7 96 28 73 150 37 38 47 109 202 123 127 74 245 74 215 224 116 161 8 128 96 19 36 216 144 64 16 236 193 136 205 230 146 236 29 105 71 35 41 171 42 129 202 101 86 101 93 102 22 64 204 237 157 188 247 222 123 239 189 247 222 123 239 189 247 186 59 157 78 39 247 223 255 63 92 102 100 1 108 246 206 74 218 201 158 33 128 170 200 31 63 126 124 31 63 34 190 247 107 188 249 53 78 127 141 215 244 239 247 127 141 255 39 0 0 255 255
Anybody has an idea why this behave so strange?
DeflateStream manual
This class represents the Deflate algorithm, which is an industry-standard algorithm for lossless file compression and decompression. Starting with the .NET Framework 4.5, the DeflateStream class uses the zlib library. As a result, it provides a better compression algorithm and, in most cases, a smaller compressed file than it provides in earlier versions of the .NET Framework.
Given the following list of x,y,z points (z is actually a signal strength indicator in dBm):
63 371 -21
142 371 -9
233 374 -18
288 371 -36
310 373 -38
349 374 -39
415 348 -44
507 334 -49
689 337 -56
635 254 -57
422 284 -42
380 278 -39
281 280 -39
214 299 -34
146 285 -30
81 302 -39
76 246 -39
80 214 -44
137 200 -44
64 134 -48
73 87 -48
200 101 -46
230 202 -44
246 105 -53
285 109 -53
278 191 -50
334 87 -54
395 189 -56
513 208 -58
510 99 -61
553 101 -62
593 100 -65
634 101 -64
679 102 -68
731 196 -70
I can quite easily generate a 3D scatter plot using this command in gnuplot:
splot "C:/path/to/points.dat" with points
What I'm really after is a way to "fill in the gaps" and create a surface. The ultimate goal is to use data like the points shown above to generate an RF map for a given WiFi access point. The resulting map would be used to calculate the possible locations of a device, given its RSSI (received signal strength indicator).
(Several APs and their associated RF maps will be used, however I don't think the specifics are relevant to this question.)
What would be the best way to interpolate the z-values (RSSI in dBm, in this case) for the remaining points?
EDIT :
I seem to have made some progress. Using set dgrid3d 50,100 splines before the splot command seems to generate more or less what I'm looking for. So the next question is: how can I replicate this kind of function in code (C#, ideally)?
Realizing that I should be using Line Print mode (as opposed to label mode) for sending CPCL to the Zebra QL 220 belt printer, I'm in the process of refactoring my working code (Why does everything print on the same line, even though I'm adding crlfs?) to this:
serialPort.Write("! 0 200 200 210 1\r\n");
serialPort.Write(string.Format("! U1 setvar {0} {1}", "device.languages", "line_print"));
serialPort.Write("Hallo die Welt\r\n\r\n"); //Bonjour le Monde --- Hola el Mundo --- Hallo die Welt
serialPort.Write("BARCODE-TEXT 7 0 5\r\n");
serialPort.Write(string.Format("BARCODE 128 1 1 50 150 130 {0}\r\n\r\n", barcode));
serialPort.Write("POSTFEED 120\r\n"); // empirical observation shows 120 is about the right amount of extra tape to expel after printing
serialPort.Write("PRINT\r\n");
This prints the barcode and its human-readable number beneath it (the value in "barcode"),but the text "Hallo die Welt" is not printed. Why not? Do I need a call to Print after each line, or...???
UPDATE
It still prints the barcode only (not "Hallo die Welt") with this code:
serialPort.Write("! 0 200 200 210 1\r\n");
serialPort.Write("! U1 SETLP 7 0 24\r\n");
serialPort.Write("Hallo die Welt\r\n\r\n");
serialPort.Write("BARCODE-TEXT 7 0 5\r\n");
serialPort.Write(string.Format("BARCODE 128 1 1 50 150 130 {0}\r\n\r\n", barcode));
serialPort.Write("POSTFEED 120\r\n");
serialPort.Write("PRINT\r\n");
UPDATE 2
This works (label mode):
serialPort.Write("! 0 200 200 210 1\r\n");
serialPort.Write("TEXT 4 0 30 40 Hallo die Welt\r\n\r\n"); //Bonjour le Monde --- Hola el Mundo --- Hallo die Welt
serialPort.Write("BARCODE-TEXT 7 0 5\r\n");
serialPort.Write(string.Format("BARCODE 128 1 1 50 150 130 {0}\r\n\r\n", barcode));
serialPort.Write("POSTFEED 120\r\n");
serialPort.Write("PRINT\r\n");
It prints:
~~~~~~~~~~~~~~~~~~~~~~~
Hallo die Welt
<barcode as a barcode>
<barcode as a number>
~~~~~~~~~~~~~~~~~~~~~~~
...but this doesn't work (line print mode):
serialPort.Write(string.Format("! U1 setvar {0} {1}", "device.languages", "line_print"));
serialPort.Write("! U1 SETLP 7 0 24\r\n");
serialPort.Write("Hallo die Welt\r\n\r\n");
serialPort.Write("! U1 BARCODE-TEXT 7 0 5\r\n");
serialPort.Write(string.Format("! U1 BARCODE 128 1 1 50 150 130 {0}\r\n\r\n", barcode));
serialPort.Write("! U1 SETLP 5 2 46");
serialPort.Write(barcode);
serialPort.Write("! U1 PRINT\r\n");
The problem is, I need to use Line Print mode.
You also need a \r\n after every SGD command (your setvar in this case)
It should be
! U1
setvar "device.languages" "line_print"\r\n
You also need to put the double quotes around the 2 parameters of the SETVAR command.
UPDATE:
oh, btw, just because the printer is in line_print mode, doesn't mean that it doesn't understand CPCL code. So the code above in your example is CPCL code, not just line print. If you put TEXT in front, it should work