Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
ab704303
Commit
ab704303
authored
Mar 28, 2012
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert image to pdf-file, tmp file name fix
parent
471c7737
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
src/exe/co_convert/src/cnv_topdf.cpp
src/exe/co_convert/src/cnv_topdf.cpp
+4
-2
src/lib/co/src/co_dcli.c
src/lib/co/src/co_dcli.c
+11
-0
src/lib/co/src/co_dcli.h
src/lib/co/src/co_dcli.h
+1
-0
No files found.
src/exe/co_convert/src/cnv_topdf.cpp
View file @
ab704303
...
...
@@ -258,6 +258,7 @@ void CnvPdfObj::print_end()
int
CnvPdfObj
::
print_image
()
{
pwr_tCmd
cmd
;
cnv_tImImage
image
;
cnv_tPixmap
pixmap
;
pwr_tFileName
fname
;
...
...
@@ -314,7 +315,7 @@ number + topdf->v_outline.size() + topdf->v_pages.size() + topdf->v_content.size
start
=
(
int
)
topdf
->
fp
[
topdf
->
cf
].
tellp
();
s
trcpy
(
fname
,
"/tmp/pwr_cnv.jpg"
);
s
printf
(
fname
,
"/tmp/pwr_cnv_%08u.jpg"
,
dcli_random
()
);
cnv_print_image
(
image
,
fname
);
ifstream
fimg
(
fname
);
...
...
@@ -330,7 +331,8 @@ number + topdf->v_outline.size() + topdf->v_pages.size() + topdf->v_content.size
cnv_free_image
(
image
,
pixmap
);
fimg
.
close
();
system
(
"rm /tmp/pwr_cnv.jpg"
);
sprintf
(
cmd
,
"rm %s"
,
fname
);
system
(
cmd
);
return
1
;
}
...
...
src/lib/co/src/co_dcli.c
View file @
ab704303
...
...
@@ -1222,3 +1222,14 @@ int dcli_read_line( char *line, int maxsize, FILE *file)
return
1
;
}
unsigned
int
dcli_random
()
{
pwr_tTime
t
;
time_GetTime
(
&
t
);
int
itime
=
t
.
tv_nsec
+
t
.
tv_sec
%
10000
;
srand
(
itime
);
return
(
unsigned
int
)((
double
)
rand
()
/
((
double
)
RAND_MAX
+
1
)
*
999999
);
}
src/lib/co/src/co_dcli.h
View file @
ab704303
...
...
@@ -90,6 +90,7 @@ char *dcli_pwr_dir( const char *dir);
int
dcli_wildcard
(
char
*
wildname
,
char
*
name
);
int
dcli_read_line
(
char
*
line
,
int
maxsize
,
FILE
*
file
);
unsigned
int
dcli_random
();
/* Functions in module co_dcli_file */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment