cupsrasterreadpixels fails

shermin sherminismail at gmail.com
Sun Oct 5 04:57:53 PDT 2008


Hi,
I tried printing the contents of my rasterdata and it returns 0 for all bytes.Eventhough cupsRasterReadPixels returns 2585176 its content when i logged in a log file returns 0
1)What could be the reason.
While trying to print one .bmp file these is the error log i am getting


Started filter /usr/lib/cups/filter/pstops (PID 26462)
Started filter /usr/lib/cups/filter/pstoraster (PID 26463)
Started backend /usr/lib/cups/backend/new_usb (PID 26464)
and also  in the error log

file->mimetype=application/octet-stream in the admin.cgi portion
2)Is this correct??
Shermin

> shermin wrote:
> > Hi,
> > Value of print_fd is 0
> > CupsRasterOPen is "not" returning NULL
> >
> > cupsRasterReadPixels returns 2585176
>
> Is 2585176 equal to cupsHeight * cupsBytesPerLine?
>
> Why do you think the rasterData buffer contains no data?
>
> > errno is -1209461948(resource temporarily unavailable)
> >
> > What I did is I am modifying the print_device() code in libusb.c(backend) in cups 1.4.
> > I am trying to read the rasterdata inside this function .print_fd value I got is from usb.c which is passed to libusb.c.
> >
> > while (cupsRasterReadHeader2(ras, &header))
> > {
> >        rasterData=malloc((header.cupsHeight)*(header.cupsBytesPerLine));		raster_read=cupsRasterReadPixels(ras, rasterData, ((header.cupsHeight) * (header.cupsBytesPerLine)));
> >
> >    fprintf(stderr,"Raster read pixel value is %d\n",raster_read);
> > }
> >
> > Shermin
> >
> >
> >> shermin wrote:
> >>> Hi,
> >>> I am writing backend using libusb and in print_device function i am using
> >>> ras = cupsRasterOpen(print_fd, CUPS_RASTER_READ);
> >>> cupsRasterReadPixels(ras, rasterData, ((header.cupsHeight) * (header.cupsBytesPerLine)) and this rasterData contains NO data.
> >>> What could be the reason?
> >> What is the value of print_fd?
> >>
> >> What is cupsRasterOpen returning?
> >>
> >> What is cupsRasterReadPixels returning?
> >>
> >> What does errno contain after the cupsRasterReadPixels call?
> >>
> >> --
> >> ______________________________________________________________________
> >> Michael R Sweet                        Senior Printing System Engineer
> >>
> >
> > _______________________________________________
> > cups mailing list
> > cups at easysw.com
> > http://lists.easysw.com/mailman/listinfo/cups
>
>
> --
> ______________________________________________________________________
> Michael R Sweet                        Senior Printing System Engineer
>





More information about the cups mailing list