Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #235477

Re: xv

From "Thomas Schmitt" <scdbackup@gmx.net>
Newsgroups linux.debian.user
Subject Re: xv
Date 2021-05-23 22:30 +0200
Message-ID <Ci2Tw-8m1-9@gated-at.bofh.it> (permalink)
References <Ci05k-6FW-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

i wrote:
> > halve_jpeg.c

Dan Hitt wrote:
> It was unwilling to deal with a non-color image that i had ("Unsuitable JPEG
> format with 1 components per pixel"), [...]
> if i need to deal with non-color images, i can try to modify it.

It is much ad-hoc work, i have to confess. The images which made my computer
mad came from a professional camera and all were in 3 colors.

Every occurence of 3 between "2013" and "if(argc < 3)" would have to
become hjpg->cinfo_in.output_components.

Next problem is the hardcoded
  cinfo_out->in_color_space= JCS_RGB;
which must become hjpg->cinfo_in.out_color_space.

Another need for change might come from the program's habit to size down
to half edge length by default.
(Originally this was its only mode because it was only intended to make
the image size digestible for ImageMagick "convert". Then i got carried
away and implemented more flexible scaling.)

-------------------------------------------------------------------------

I forked a new program  reformat_jpeg.c  and implemented those changes.
It seems to work with grayscale
  https://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Nine_steps_stair_in_Lysekil_-_bw.jpg/800px-Nine_steps_stair_in_Lysekil_-_bw.jpg
and with the color images i tested up to now.
(Ye olde halve_jpeg got lots of testing during the years.)

Download:
  http://scdbackup.sourceforge.net/reformat_jpeg.c
(if sourceforge gets over its 503 and 504 errors of today)
SHA256:
  64ab46e8102e304558f0a10c85cc2dd08010d4346c50ab4eca678049d2b9c260

Compilation:
  cc -g -Wall -o reformat_jpeg reformat_jpeg.c -ljpeg

Usage is like with halve_jpeg, except the size default.


Have a nice day :)

Thomas

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: xv Dan Hitt <dan.hitt@gmail.com> - 2021-05-23 03:30 +0200
  Re: xv Dan Hitt <dan.hitt@gmail.com> - 2021-05-23 19:30 +0200
    Re: xv "Thomas Schmitt" <scdbackup@gmx.net> - 2021-05-23 22:30 +0200
      Re: xv Dan Hitt <dan.hitt@gmail.com> - 2021-05-24 00:40 +0200
  Re: xv "Thomas Schmitt" <scdbackup@gmx.net> - 2021-05-23 13:40 +0200

csiph-web