|
|
|
|
|
|
|
|
my $originaldir = $conf->{path}{global}.'/'.$conf->{path}{original}; |
|
|
my $originaldir = $conf->{path}{global}.'/'.$conf->{path}{original}; |
|
|
|
|
|
|
|
|
my %langid; |
|
|
my %langid; |
|
|
|
|
|
my %primary; |
|
|
my $q = sqlquery($dbh, "SELECT id,short FROM lang"); |
|
|
my $q = sqlquery($dbh, "SELECT id,short FROM lang"); |
|
|
while(my($id,$short)=$q->fetchrow_array()) { $langid{$short}=$id; } |
|
|
while(my($id,$short)=$q->fetchrow_array()) { $langid{$short}=$id; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print "new page id $pageid\n"; |
|
|
print "new page id $pageid\n"; |
|
|
update_page_status($pageid, 'inprogress'); |
|
|
update_page_status($pageid, 'inprogress'); |
|
|
|
|
|
|
|
|
|
|
|
if ( !exists $primary{$docid} ) { |
|
|
|
|
|
$primary{$docid}=undef; |
|
|
|
|
|
sqlquery($dbh, "CALL set_primary_page(?)",$pageid); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print "create original page jpeg $pageid.jpeg"; |
|
|
print "create original page jpeg $pageid.jpeg"; |
|
|
system(sprintf("pdftoppm -f %s -l %s -r 300 -jpeg -singlefile %s/%s %s/%s", $page+1, $page+1, $queuedir, $file, $originaldir, $pageid)); |
|
|
system(sprintf("pdftoppm -f %s -l %s -r 300 -jpeg -singlefile %s/%s %s/%s", $page+1, $page+1, $queuedir, $file, $originaldir, $pageid)); |
|
|
system(sprintf("mv %s/%s.jpg %s/%s.jpeg", |
|
|
system(sprintf("mv %s/%s.jpg %s/%s.jpeg", |