New answers tagged

0

It was a small typo in the code. Thanks.


0

Recall that in the class, David and Brian used an example of two glasses with liquids. To change the liquids without changing the place of the glasses it was necessary a third glass, otherwise, the liquids would be mixed. Looks like you're using the original image to do the math and changing the value of each pixel in the process. If you don't use a copy of ...


1

Program is not producing any jpgs because it is reading itself. Recall from the lecture the first element in argv is the program's name, so the problem is here. FILE *card = fopen(argv[0],"r"); From the spec: Thanks to FAT, you can trust that JPEGs’ signatures will be “block-aligned.” That is, you need only look for those signatures in a block’s ...


1

The IDE isn't able to recognize the card.raw file as something that can be opened as any particular file type. When I double-click on it, the IDE hangs, as you experienced. My browser didn't crash (Firefox), it gave me a popup error message after it timed out. Yours may have actually crashed, I can't explain that. However, if you right click on the file ...


1

It's a subtle but critical error. The problem lies here; int buffer[512]; ... for(int i = 0; i < 512; i++) { fread(&buffer[i], 1, 1, raw); } Here's what's happening. The fread() call reads exactly one byte and stores it in one element of the buffer[] array. But, each element in the array is 4 bytes long! The remaining bytes are ...


Top 50 recent answers are included