Browse Source

Fixed issue with input and output files not being set

refactor
5 years ago
parent
commit
5d40794f1f
  1. 7
      source/Printer.cpp
  2. 2
      source/Printer.h

7
source/Printer.cpp

@ -43,19 +43,21 @@ t_printdata printdata; // extern @@ -43,19 +43,21 @@ t_printdata printdata; // extern
// Sends specified file to printer (bmp=NULL) or to bitmap file.
void Printfile(const std::string &path, const std::string &bmp)
t_printdata Printfile(const std::string &path, const std::string &bmp)
{
// Prepare descriptor.
// memset(&printdata,0,sizeof(printdata));
t_printdata printdata = {};
printdata.infile = path;
std::cout << "bmp: " << bmp << " and length: " << bmp.length() << std::endl;
if ( bmp.length() > 0 )
if ( bmp.length() > 0 ) {
printdata.outbmp = bmp;
}
std::cout << "outbmp: " << printdata.outbmp << std::endl;
// Start printing.
printdata.step=1;
// Updatebuttons();
return printdata;
};
@ -263,7 +265,6 @@ int Initializeprinting(t_printdata *print, uint pageWidth, uint pageHeight) { @@ -263,7 +265,6 @@ int Initializeprinting(t_printdata *print, uint pageWidth, uint pageHeight) {
strncpy(print->superdata.name,fil,32); // don't overwrite the salt and iv at the end of this buffer
print->superdata.name[31] = '\0'; // ensure that later string operations don't overflow into binary data
// If printing to paper, ask user to select printer and, if necessary, adjust
// parameters. I do not enforce high quality or high resolution - the user is
// the king (well, a sort of).

2
source/Printer.h

@ -94,7 +94,7 @@ typedef struct t_printdata { // Print control structure @@ -94,7 +94,7 @@ typedef struct t_printdata { // Print control structure
extern int resx,resy; // Printer resolution, dpi (may be 0!)
extern t_printdata printdata; // Print control structure
void Printfile(const std::string &path, const std::string &bmp);
t_printdata Printfile(const std::string &path, const std::string &bmp);
void Preparefiletoprint(t_printdata *print);
int Initializeprinting(t_printdata *print, uint pageWidth, uint pageHeight);
void Stopprinting(t_printdata *print);

Loading…
Cancel
Save