Questions tagged [decoding]

Decoding is the reverse of encoding.

Decoding is the reverse of , which is the process of transforming information from one format into another understandable by a receiver. In communication theory and coding theory, decoding is the process of translating received messages into codewords of a given code. Like encoding, decoding applies to information of various forms:

1741 questions
22
votes
3 answers

Android how to scale an image with BitmapFactory Options

I want to decode an image from the SD card with BitmapFactory.decodeFile(path, options). I also want images that are larger than 2048x2048 pixels to be scaled down to at most 2048x2048 (maintaining the proportions). I could do this manually after…
saarraz1
  • 2,999
  • 6
  • 29
  • 44
22
votes
13 answers

Shortest possible encoded string with a decode possibility (shorten URL) using only PHP

I'm looking for a method that encodes a string to the shortest possible length and lets it be decodable (pure PHP, no SQL). I have working script, but I'm unsatisfied with the length of the encoded string. Scenario Link to an image (it depends on…
Artur Filipiak
  • 9,027
  • 4
  • 30
  • 56
21
votes
5 answers

Base64URL decoding via JavaScript?

So I'm stumped. I know there's lots of Base64 encoders/decoders for JS, but not for the modified (and Facebook-favored) Base64URL variation. So far searching across stackoverflow has come up dry. Yes, I could use PHP or another server-side library…
chrisfullman
  • 221
  • 1
  • 2
  • 5
19
votes
4 answers

How to encode and decode data in base64 and base64URL by using unix commands?

Base64 encode can be achieved by $ echo Some_data_to_be_converted | base64 U29tZV9kYXRhX3RvX2JlIF9jb252ZXJ0ZWQK And Base64 decode can be achieved by $ echo U29tZV9kYXRhX3RvX2JlIF9jb252ZXJ0ZWQK | base64 -d Some_data_to_be_converted How to…
MALATESH K
  • 191
  • 1
  • 1
  • 3
19
votes
4 answers

Node.js Base64 Image decoding and writing to file

I'm sending the contents of this Flex form (Don't ask why) over to node. There is a post paramteter called "photo" which is a base64 encoded image. Contents of photo get sent over ok. Problem is when I am trying to decode the content and write them…
Mehdi
  • 803
  • 2
  • 11
  • 16
18
votes
4 answers

Android byte[] to image in Camera.onPreviewFrame

When trying to convert the byte[] of Camera.onPreviewFrame to Bitamp using BitmapFactory.decodeByteArray gives me an error SkImageDecoder::Factory returned null Following is my code: public void onPreviewFrame(byte[] data, Camera camera) { …
Vinod Maurya
  • 4,167
  • 11
  • 50
  • 81
18
votes
1 answer

Detect if a file is an MP3 file?

I'm writing a C++ library for decoding and encoding audio between different formats/codecs. I have a routine for quickly detecting the format before loading the required codec library. For WAV files one can simple look for the ASCII values "RIFF"…
goocreations
  • 2,938
  • 8
  • 37
  • 59
17
votes
4 answers

Base64 Encoding: Illegal base64 character 3c

I am trying to decode data in an xml format into bytes base64 and I am having an issues. My method is in java which takes a String data and converts it into bytes like as bellow. String data = "......"; //string of data in xml format byte[]…
VMA92
  • 469
  • 2
  • 8
  • 19
16
votes
10 answers

Free/Open h.264 video decoding libraries? (Non-GPL)

The main players seem to be x264, and xvid, and both are GPL. This means we can't integrate decoding capabilities into a playback application without licensing the whole thing as GPL, so we can't use either. The preferred target platform is Linux.…
Mark Renouf
  • 30,697
  • 19
  • 94
  • 123
16
votes
2 answers

What is difference between decode and decode' functions from aeson package?

Functions decode and decode' from aeson package are almost identical. But they have subtle difference described in documentation (posting only interesting part of docs here): -- This function parses immediately, but defers conversion. See -- 'json'…
Shersh
  • 9,019
  • 3
  • 33
  • 61
16
votes
2 answers

Python - Replace non-ascii character in string (»)

I need to replace in a string the character "»" with a whitespace, but I still get an error. This is the code I use: # -*- coding: utf-8 -*- from bs4 import BeautifulSoup # other code soup = BeautifulSoup(data, 'lxml') mystring =…
Hyperion
  • 2,515
  • 11
  • 37
  • 59
15
votes
1 answer

How to set decode pixel format in libavcodec?

I decode video via libavcodec, using the following code: //Open input file if(avformat_open_input(&ctx, filename, NULL, NULL)!=0) return FALSE; // Couldn't open file if(avformat_find_stream_info(ctx, NULL)<0) return FALSE; // Couldn't find…
kochedykov
  • 153
  • 1
  • 1
  • 7
15
votes
5 answers

How to display Bitmap Image in Android

I am making an application in which i am getting an Mjpg Images from Live IP Camera in Android. The problem is that since when i get the Image in the form of ByteArray. How can I display the Image? I'm using the following code to display the…
Shah
  • 4,990
  • 10
  • 48
  • 70
15
votes
4 answers

UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 34: unexpected end of data

I'm trying to write a scraper , but I'm having issues with encoding. When I tried to copy the string I was looking for into my text file, python2.7 told me it didn't recognize the encoding, despite no special characters. Don't know if that's useful…
user3701032
  • 153
  • 1
  • 1
  • 5
15
votes
4 answers

How to Decode the & from a URL so that header() works (urldecode not working)

I have the following URL: $url = 'http://mysite.com/?p=welcome&x=1&y=2'; I need to decode it so that header("Location: $url"); actually works. However, using urldecode($url) is not working because it's not decoding the & -> & and so the…
ProgrammerGirl
  • 3,157
  • 7
  • 45
  • 82