octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #60430] Octave script steals focus constantly


From: anonymous
Subject: [Octave-bug-tracker] [bug #60430] Octave script steals focus constantly
Date: Wed, 21 Apr 2021 05:56:45 -0400 (EDT)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?60430>

                 Summary: Octave script steals focus constantly
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Wed 21 Apr 2021 09:56:43 AM UTC
                Category: GUI
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Performance
                  Status: None
             Assigned to: None
         Originator Name: Richard Leaver
        Originator Email: richard.leaver@me.com
             Open/Closed: Open
                 Release: 6.2.0
         Discussion Lock: Any
        Operating System: Mac OS

    _______________________________________________________

Details:

https://octave.discourse.group/t/octave-script-bug-for-checking-jpg-image-validity/1078/2

Mac OSX  Octave latest

Working script but invoking steals focus constantly for multiple files.

eg mkdir -p errdir baddir 
./badimage errdir baddir a.jpg

______

#!/usr/bin/octave -qf                                                         
                                                                              
                                                                              
                                                                              
                                                                              
                                                                              
                                                                 

threshold = 0.25;

usage = "Usage is: badfiles <file...> OR badfiles <errdir> <baddir>
<file...>\n";

assert(nargin>0, usage);
dryrun = isfile(argv{1});
if !dryrun
  errdir = argv{1};
  baddir = argv{2};
  assert(isfolder(errdir) && isfolder(baddir) && isfile(argv{3}), usage);
endif

start = 1 + 2*(!dryrun);

for fname = argv()(start:end)'

  q = [];
  f = fname{1};

  warning error
  try
    q = imread(fname{1});
  catch err
  end_try_catch
  warning on

  if isempty(q)
    printf("error\t");
    dryrun || movefile(f, errdir);
  else
    qt = all(q == q(end,1,:) ,2);
    qtt = squeeze(all(qt, 3));
    r = 1 - find(qtt==0, 1, 'last') / size(q, 1);
    if (r > threshold)
      printf("bad--%02d\t", ceil(100*r));
      dryrun || movefile(f, baddir);
    else
      printf("good-%02d\t", ceil(100*r));
    endif
  endif

  disp(f);
endfor










________



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 21 Apr 2021 09:56:43 AM UTC  Name: badimage  Size: 875B   By: None

<http://savannah.gnu.org/bugs/download.php?file_id=51301>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60430>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]