Giter Club home page Giter Club logo

python-jpeg-toolbox's Introduction

python-jpeg-toolbox's People

Contributors

daniellerch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

python-jpeg-toolbox's Issues

Fails To Install From Source

python3 setup.py install

/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/command/easy_install.py:146: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
jpeg_toolbox_extension.c: In function ‘read_file’:
jpeg_toolbox_extension.c:197:53: error: ‘struct jpeg_decompress_struct’ has no member named ‘block_size’
  197 |    result = dict_add_int(result, "block_size", cinfo.block_size);
      |                                                     ^
jpeg_toolbox_extension.c:198:65: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’; did you mean ‘min_DCT_scaled_size’?
  198 | esult = dict_add_int(result, "min_DCT_h_scaled_size", cinfo.min_DCT_h_scaled_size);
      |                                                             ^~~~~~~~~~~~~~~~~~~~~
      |                                                             min_DCT_scaled_size
jpeg_toolbox_extension.c:199:65: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’; did you mean ‘min_DCT_scaled_size’?
  199 | esult = dict_add_int(result, "min_DCT_v_scaled_size", cinfo.min_DCT_v_scaled_size);
      |                                                             ^~~~~~~~~~~~~~~~~~~~~
      |                                                             min_DCT_scaled_size
jpeg_toolbox_extension.c:219:63: error: ‘jpeg_component_info’ has no member named ‘DCT_h_scaled_size’; did you mean ‘DCT_scaled_size’?
  219 |     comp = dict_add_int(comp, "DCT_h_scaled_size", compptr->DCT_h_scaled_size);
      |                                                             ^~~~~~~~~~~~~~~~~
      |                                                             DCT_scaled_size
jpeg_toolbox_extension.c:220:63: error: ‘jpeg_component_info’ has no member named ‘DCT_v_scaled_size’; did you mean ‘DCT_scaled_size’?
  220 |     comp = dict_add_int(comp, "DCT_v_scaled_size", compptr->DCT_v_scaled_size);
      |                                                             ^~~~~~~~~~~~~~~~~
      |                                                             DCT_scaled_size
jpeg_toolbox_extension.c: In function ‘write_file’:
jpeg_toolbox_extension.c:475:9: error: ‘struct jpeg_compress_struct’ has no member named ‘block_size’
  475 |    cinfo.block_size = dict_get_int(data, "block_size");
      |         ^
jpeg_toolbox_extension.c:476:9: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’
  476 |    cinfo.min_DCT_h_scaled_size = dict_get_int(data, "min_DCT_h_scaled_size");
      |         ^
jpeg_toolbox_extension.c:477:9: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’
  477 |    cinfo.min_DCT_v_scaled_size = dict_get_int(data, "min_DCT_v_scaled_size");
      |         ^
jpeg_toolbox_extension.c:500:16: error: ‘jpeg_component_info’ has no member named ‘DCT_h_scaled_size’; did you mean ‘DCT_scaled_size’?
  500 |       compptr->DCT_h_scaled_size = dict_get_int(item, "DCT_h_scaled_size");
      |                ^~~~~~~~~~~~~~~~~
      |                DCT_scaled_size
jpeg_toolbox_extension.c:501:16: error: ‘jpeg_component_info’ has no member named ‘DCT_v_scaled_size’; did you mean ‘DCT_scaled_size’?
  501 |       compptr->DCT_v_scaled_size = dict_get_int(item, "DCT_v_scaled_size");
      |                ^~~~~~~~~~~~~~~~~
      |                DCT_scaled_size
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

Description of paramters?

Thanks for your work.

When I read an image with your toolbox, it has the following keys:

'image_width', 'image_height', 'image_color_space', 'image_components', 'jpeg_color_space', 'jpeg_components', 'progressive_mode', 'comp_info', 'quant_tables', 'ac_huff_tables', 'dc_huff_tables', 'coef_arrays'

I am not sure about the meaning of them. For example, what is the meaning of 'jpeg_color_space' = 3?
Can you provide their descriptions (or the reference of descriptions)?

jpeg_toolbox.load() returns empty dictionary

Hi, thanks for such a good work ! When I try to use the jpeg_toolbox.load() to read my jpg pics, it returns an empty dictionary, the original error is:


KeyError Traceback (most recent call last)
in
1 prefix = "../data/JPG"
2
----> 3 test = jpeg_toolbox.load(f"{prefix}/00899.jpg")

/data/anaconda3/lib/python3.8/site-packages/jpeg_toolbox.py in load(path, use_blocks)
23 r = jpeg.read_file(path.encode())
24
---> 25 r["quant_tables"] = np.array(r["quant_tables"])
26
27 for i in range(len(r["ac_huff_tables"])):

KeyError: 'quant_tables'

My python environment is 3.8 with Linux version 4.4.0-210-generic (buildd@lgw01-amd64-009) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) ). Have no clue why this happened. Is there any thing I've missed ? and what's the exact environment this repository is compatible with? Thanks if you can help me out.

"save" does not work

the function "jpeg_toolbox.save()" does not work, I got a jpeg image with size of 0kb through the function everytime. How should I resolve this problem?

New branch fails to build. Possibly a missing install dependency.

Collecting git+https://github.com/daniellerch/python-jpeg-toolbox
Cloning https://github.com/daniellerch/python-jpeg-toolbox to /tmp/pip-req-build-ugg2z4_c
Running command git clone -q https://github.com/daniellerch/python-jpeg-toolbox /tmp/pip-req-build-ugg2z4_c
Building wheels for collected packages: jpeg-toolbox
Building wheel for jpeg-toolbox (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-ugg2z4_c/setup.py'"'"'; file='"'"'/tmp/pip-req-build-ugg2z4_c/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);c
ode=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-vv3t_jj4
cwd: /tmp/pip-req-build-ugg2z4_c/
Complete output (15 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
copying jpeg_toolbox.py -> build/lib.linux-x86_64-3.8
running build_ext
building 'jpeg_toolbox_extension' extension
creating build/temp.linux-x86_64-3.8
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-t
ime -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c jpeg_toolbox_extension.c -o build/temp.linux-x86_64-3.8/jpeg_toolbox_extension.o
jpeg_toolbox_extension.c:4:10: fatal error: jerror.h: No such file or directory
4 | #include <jerror.h>
| ^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

ERROR: Failed building wheel for jpeg-toolbox

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.