linuxOS_AP06/buildroot/package/hplip/0003-Remove-all-ImageProcessor-functionality-which-is-clo.patch

145 lines
5.6 KiB
Diff
Raw Normal View History

2025-06-03 04:28:32 +00:00
From 056fb547491008b52d74c29e40136e85cde08847 Mon Sep 17 00:00:00 2001
From: Didier Raboud <odyx@debian.org>
Date: Tue, 21 Aug 2018 18:18:10 +0200
Subject: [PATCH 3/5] Remove all ImageProcessor functionality, which is
closed-source
---
Makefile.am | 18 ++------------
prnt/hpcups/HPCupsFilter.cpp | 46 ------------------------------------
2 files changed, 2 insertions(+), 62 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index c111be6..7034ccf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -167,7 +167,7 @@ if !HPLIP_CLASS_DRIVER
dist_hplip_SCRIPTS = hpssd.py __init__.py hpdio.py
endif #HPLIP_CLASS_DRIVER
-dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template prnt/hpcups/libImageProcessor-x86_64.so prnt/hpcups/libImageProcessor-x86_32.so
+dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template
dist_noinst_DATA += prnt/ipp-usb/HPLIP.conf
dist_noinst_SCRIPTS += dat2drv.py install.py hplip-install init-suse-firewall init-iptables-firewall class_rpm_build.sh hplipclassdriver.spec createPPD.sh Makefile_dat2drv hpijs-drv
@@ -597,7 +597,7 @@ hpcups_SOURCES = prnt/hpcups/HPCupsFilter.cpp prnt/hpcups/HPCupsFilter.h prnt/hp
prnt/hpcups/ImageProcessor.h
hpcups_CXXFLAGS = $(APDK_ENDIAN_FLAG) $(DBUS_CFLAGS)
-hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lImageProcessor -lcups -lcupsimage -lz $(DBUS_LIBS)
+hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lcups -lcupsimage -lz $(DBUS_LIBS)
#else
#hpcupsdir = $(cupsfilterdir)
#hpcups_PROGRAMS = hpcups
@@ -695,20 +695,6 @@ endif #HPLIP_CLASS_DRIVER
install-data-hook:
if HPLIP_BUILD
- if [ \( "$(UNAME)" = "x86_64" -a -d "$(libdir)/" \) ]; then \
- cp prnt/hpcups/libImageProcessor-x86_64.so $(libdir)/ ; \
- chmod 775 $(libdir)/libImageProcessor-x86_64.so ; \
- ln -sf $(libdir)/libImageProcessor-x86_64.so $(libdir)/libImageProcessor.so ; \
- fi; \
- if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/" \) ]; then \
- cp prnt/hpcups/libImageProcessor-x86_32.so $(libdir)/ ; \
- chmod 775 $(libdir)/libImageProcessor-x86_32.so ; \
- ln -sf $(libdir)/libImageProcessor-x86_32.so $(libdir)/libImageProcessor.so ; \
- fi
- if [ -d "/usr/share/ipp-usb/quirks/" ]; then \
- echo "ipp-usb directory exists"; \
- cp prnt/ipp-usb/HPLIP.conf /usr/share/ipp-usb/quirks/ ; \
- fi
if !HPLIP_CLASS_DRIVER
# If scanner build, add hpaio entry to sane dll.conf.
if [ "$(scan_build)" = "yes" ]; then \
diff --git a/prnt/hpcups/HPCupsFilter.cpp b/prnt/hpcups/HPCupsFilter.cpp
index e973831..eff57b2 100644
--- a/prnt/hpcups/HPCupsFilter.cpp
+++ b/prnt/hpcups/HPCupsFilter.cpp
@@ -32,10 +32,6 @@
#include "HPCupsFilter.h"
-#ifndef DISABLE_IMAGEPROCESSOR
-#include "ImageProcessor.h"
-#endif
-
#include <signal.h>
#include <sys/wait.h>
#include <sys/utsname.h>
@@ -660,26 +656,8 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster)
sprintf(hpPreProcessedRasterFile, "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name);
- #ifndef DISABLE_IMAGEPROCESSOR
- image_processor_t* imageProcessor=NULL;
- IMAGE_PROCESSOR_ERROR result;
- //added if condition to check if pinter language is "ljzjstream"
- //If so, then bypass imageprocessing functions while running HPCUPS filter.
-
- if(strncmp(m_JA.printer_platform, "ljzjstream",10) == 0){
- imageProcessor = imageProcessorCreate();
- }
- #endif
while (cupsRasterReadHeader2(cups_raster, &cups_header))
{
- #ifndef DISABLE_IMAGEPROCESSOR
- if(strncmp(m_JA.printer_platform, "ljzjstream",10) == 0){
- result = imageProcessorStartPage(imageProcessor, &cups_header);
- if (result != IPE_SUCCESS){
- dbglog("DEBUG: imageProcessorStartPage failed result = %d\n", result);
- }
- }
- #endif
current_page_number++;
if (current_page_number == 1) {
@@ -777,15 +755,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster)
cupsRasterReadPixels (cups_raster, m_pPrinterBuffer, cups_header.cupsBytesPerLine);
color_raster = rgbRaster;
black_raster = kRaster;
- #ifndef DISABLE_IMAGEPROCESSOR
- if(strncmp(m_JA.printer_platform, "ljzjstream",10) == 0)
- {
- result = imageProcessorProcessLine(imageProcessor, m_pPrinterBuffer, cups_header.cupsBytesPerLine);
- if (result != IPE_SUCCESS){
- dbglog("DEBUG: imageProcessorProcessLine failed result = %d\n", result);
- }
- }
- #endif
if ((y == 0) && !is_ljmono) {
//For ljmono, make sure that first line is not a blankRaster line.Otherwise printer
//may not skip blank lines before actual data
@@ -814,15 +783,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster)
WriteBMPRaster (kfp, black_raster, cups_header.cupsWidth/8, BLACK_RASTER);
}
} // for() loop end
- #ifndef DISABLE_IMAGEPROCESSOR
- if(strncmp(m_JA.printer_platform, "ljzjstream",10) == 0)
- {
- result = imageProcessorEndPage(imageProcessor);
- if (result != IPE_SUCCESS){
- dbglog("DEBUG: imageProcessorEndPage failed result = %d\n", result);
- }
- }
- #endif
m_Job.NewPage();
if (err != NO_ERROR) {
break;
@@ -837,12 +797,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster)
rgbRaster = NULL;
}
- #ifndef DISABLE_IMAGEPROCESSOR
- if(strncmp(m_JA.printer_platform, "ljzjstream",10) == 0)
- {
- imageProcessorDestroy(imageProcessor);
- }
- #endif
unlink(hpPreProcessedRasterFile);
return ret_status;
--
2.20.1